Skip to main content
Skip table of contents

Select an Environment Based on Another Field

This guide covers a specific use case where Jira Automation is configured to automatically populate the Target Environments field whenever the Application field is updated.


Requirements

Golive Cloud must be installed on Jira Cloud.

Important

This example is not compatible with Jira Data Center.


Configuration Steps

This is the setup in Jira Automation for Jira Cloud:

image-20240913-155056.png

Automation Configuration

Step 1: Set the Trigger

Trigger: Field Value Changed.

This automation is triggered whenever the Application custom field (single-select) is updated.

image-20240913-155819.png

Step 2: Send Web Request

Retrieve the option IDs for the Target Environments field that match the updated Application field 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.

Step 3: Edit the Issue

Use the option IDs retrieved from the web request to update the Target Environments field.

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.