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:
Trigger: Field Value Changed
Triggered when the Application single-select custom field is updated.
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.
Web request URL:
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:
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.
Additional fields:
{
"fields": {
"Target Environments": [{{webResponses.last.body.items.id}}]
}
}
Need Assistance?
For support with integrating Golive and Jira Automation, reach out to our Customer Portal.