Autofill Jira Versions
Use Case
When testing an application and reporting bugs, manually entering detailed information for each bug can become tedious. For example, even though the Affects Version(s) field is entirely dependent on the testing environment, you still need to manually fill in both the Affects Version(s) and Environment fields. This repetitive task is prone to errors and can be quite frustrating.
Fortunately, Golive can automate this process. By leveraging resources likeTrack Application Deployments and Environment Custom Fields, Golive automatically determines the correct deployed version and populates the Affects Version(s) field in Jira for you.
Solution
First, configure an custom field to link your Jira issues with Golive environments. In the example below, we've named this custom field Detected in.
Once you set the Detected in custom field (1), the Affects versions field (2) is automatically populated:
How does this work?
Requirements
Your Golive Environments should be configured, and the deployed versions filled.
You have created an Environment Custom Field and added it to your Bug screen.
Configuration
Automation rule
For this use case, you can create a Jira Automation rule called Autofill Affects Versions:
Trigger
The rule triggers when the Detected in field is updated:
Condition
The rule only runs if the Affects versions field is empty, allowing users to overwrite the information if needed.
Action 1: Send web request
To retrieve the environment ID(s) from the Detected in field:
Web request URL:
If needed, replace Detected%20in
by the name of your Environment field (%20
is used for space - more information about URL encoding):
https://golive.apwide.net/api/customfield/environment/selected?issueKey={{issue.key}}&customfieldName=Detected%20in
Headers:
Generate an API token as described in the API Token Authentication section on the Golive documentation page.
Action 2: Send web request
To get the Golive information for the selected environment(s):
Web request URL:
https://golive.apwide.net/api/environments/search/paginated
Custom data:
{
"criteria": [
{
"name": "environmentId",
"values": [
{{webResponse.body.items.id}}
]
}
]
}
Headers:
Reuse the same token as in the previous action.
Action 3: Create version
Create the corresponding versions in the Jira project if they do not already exist:
Version name:
{{webResponse.body.environments.deployment.versionName}}
Action 4: Edit issue fields
Update the Affects versions field with the retrieved version information:
Affects versions:
{{webResponse.body.environments.deployment.versionName}}
Additional fields:
{
"fields": {
"versions": [
{{#webResponse.body.environments.deployment}} { "name" : "{{versionName}}" } {{^last}}, {{/}} {{/}}
]
}
}
Questions?
Setting up Jira can be complex for beginners. That's why we offer free assistance with configuration. If you need help, please to contact us contact us.