Skip to main content
Skip table of contents

Select an Environment Based on Another Field

In this use case, we automatically select the relevant production environment(s) in the Target Environments field when the Application field is updated in Jira.


Requirements

Golive Cloud must be installed on Jira Cloud (not compatible with Jira Data Center).


Configuration

This is the setup in Jira Automation for Jira Cloud:

image-20240913-155056.png

Trigger: Field Value Changed

Triggered when the Application single-select custom field is updated.

image-20240913-155819.png

Action: Send Web Request

Retrieve the Retrieve the option ID(s) for the Target Environments custom field that correspond to the selected Application and the Production category.

image-20240913-155839.png

Web request URL:

TYPESCRIPT
https://golive.apwide.net/api/customfield/environment/selectable?projectKey=CRM&customfieldName=Target%20Environments&applicationName={{issue.Application.value.urlEncode}}&categoryName=Production

Info

Update projectKey, customfieldName, categoryName, and applicationName parameters as needed. Be sure to encode your Web request URL if it contains spaces or special characters.

Headers:

CODE
api-key: <your-token>
accept: application/json

Info

To learn more about generating a Golive API Token, refer to the Rest API documentation.
To learn more about the Golive Custom Field API, refer to the Environment Custom Field Rest API documentation.

Action: Edit Issue

Update the Target Environments field with the option IDs retrieved from the web request.

image-20240913-161032.png

Additional fields:

JSON
{
    "fields": {
        "Target Environments": [{{webResponses.last.body.items.id}}]
    }
}

Need Assistance?

For support with integrating Golive and Jira Automation, reach out to our Customer Portal.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.