Bug 1660237 - Default dialog values not populated when API auth type is auth token
Summary: Default dialog values not populated when API auth type is auth token
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.9.5
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: GA
: 5.9.7
Assignee: Gregg Tanzillo
QA Contact: Parthvi Vala
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On: 1659602
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-17 22:21 UTC by Satoe Imaishi
Modified: 2022-03-13 16:32 UTC (History)
2 users (show)

Fixed In Version: 5.9.7.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1659602
Environment:
Last Closed: 2019-01-23 14:35:55 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0110 0 None None None 2019-01-23 14:36:05 UTC

Comment 2 Satoe Imaishi 2018-12-18 17:17:48 UTC
https://github.com/ManageIQ/manageiq-api/pull/530

Comment 4 Parthvi Vala 2019-01-10 13:09:36 UTC
FIXED. Verified on 5.9.7.2.

Steps taken to verify:
1. Set `run_automate_methods_on_service_api_submit` to `true`.
2. Get the authentication token by sending a request to GET /api/auth.
3. Create a new domain, `domain_1`.
4. Create a Method, let's say `method_1`.
5. Create an instance, let's say `instance_1`.
6. Create a Dialog with one static element(name="static", value_type="Integer", read_only=True, required=True) with some default value, and one dynamic element(name="dynamic", value_type="Integer", read_only=True, required=True) with the endpoint pointing to `method_1` which returns default value.
7. Create a Catalog, say `catalog_1`.
8. Create a Generic Catalog item under the newly create Catalog, say `catalog_item_1`.
9. Get the `service_catalog` id and `service_template` id.
10. Send the request.

Method used: https://bugzilla.redhat.com/attachment.cgi?id=1498504

This method sets value 2 for static element and 7 for the dynamic element, both of which are reflected in the response.

Request:
curl "https://<ip_address>/api/service_catalogs/1/service_templates/1" -k -X POST -H "Content-Type" -d '{"action" : "order"}' -H "X-Auth-Token: 99e4c7176dabff26ca859a04b9c1e5dd" -H "X-MIQ-Group: EvmGroup-super_administrator"

Response:
{
    "href": "https://<ip_address>/api/service_requests/1",
    "id": "1",
    "description": "Provisioning Service [catalog_item_1] from [catalog_item_1]",
    "approval_state": "pending_approval",
    "type": "ServiceTemplateProvisionRequest",
    "created_on": "2019-01-10T12:59:13Z",
    "updated_on": "2019-01-10T12:59:13Z",
    "requester_id": "1",
    "requester_name": "Administrator",
    "request_type": "clone_to_service",
    "request_state": "pending",
    "message": "Service_Template_Provisioning - Request Created",
    "status": "Ok",
    "options": {
        "dialog": {
            "dialog_static": 2,
            "dialog_dynamic": 7
        },
        "workflow_settings": {
            "resource_action_id": "23",
            "dialog_id": "2"
        },
        "src_id": "1",
        "request_options": {
            "submit_workflow": true,
            "init_defaults": true
        },
        "cart_state": "ordered",
        "requester_group": "EvmGroup-super_administrator"
    },
    "userid": "admin",
    "source_id": "1",
    "source_type": "ServiceTemplate",
    "tenant_id": "1",
    "service_order_id": "1",
    "process": true,
    "service_templates": {
        "count": 1,
        "resources": [{
            "href": "https://<ip_address>/api/service_catalogs/1/service_templates/1"
        }],
        "actions": [{
            "name": "edit",
            "method": "post",
            "href": "https://<ip_address>/api/service_catalogs/1/service_templates"
        }, {
            "name": "delete",
            "method": "post",
            "href": "https://<ip_address>/api/service_catalogs/1/service_templates"
        }, {
            "name": "order",
            "method": "post",
            "href": "https://<ip_address>/api/service_catalogs/1/service_templates"
        }, {
            "name": "refresh_dialog_fields",
            "method": "post",
            "href": "https://<ip_address>/api/service_catalogs/1/service_templates"
        }, {
            "name": "assign",
            "method": "post",
            "href": "https://<ip_address>/api/service_catalogs/1/service_templates"
        }, {
            "name": "unassign",
            "method": "post",
            "href": "https://<ip_address>/api/service_catalogs/1/service_templates"
        }]
    }
}

Comment 6 errata-xmlrpc 2019-01-23 14:35:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0110


Note You need to log in before you can comment on or make changes to this bug.