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:
![image-20240515-144052.png](../../../__attachments/422052925/image-20240515-144052.png?inst-v=2c44be0e-4c60-4fa1-b251-18da756a8927)
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:
![image-20240515-171251.png](../../../__attachments/422052925/image-20240515-171251.png?inst-v=2c44be0e-4c60-4fa1-b251-18da756a8927)
Trigger
The rule triggers when the Detected in field is updated:
![image-20240515-170957.png](../../../__attachments/422052925/image-20240515-170957.png?inst-v=2c44be0e-4c60-4fa1-b251-18da756a8927)
Condition
The rule only runs if the Affects versions field is empty, allowing users to overwrite the information if needed.
![image-20240515-171429.png](../../../__attachments/422052925/image-20240515-171429.png?inst-v=2c44be0e-4c60-4fa1-b251-18da756a8927)
Action 1: Send web request
To retrieve the environment ID(s) from the Detected in field:
![image-20240515-171526.png](../../../__attachments/422052925/image-20240515-171526.png?inst-v=2c44be0e-4c60-4fa1-b251-18da756a8927)
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):
![image-20240515-172606.png](../../../__attachments/422052925/image-20240515-172606.png?inst-v=2c44be0e-4c60-4fa1-b251-18da756a8927)
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:
![image-20240515-172942.png](../../../__attachments/422052925/image-20240515-172942.png?inst-v=2c44be0e-4c60-4fa1-b251-18da756a8927)
Version name:
{{webResponse.body.environments.deployment.versionName}}
Action 4: Edit issue fields
Update the Affects versions field with the retrieved version information:
![image-20240515-173149.png](../../../__attachments/422052925/image-20240515-173149.png?inst-v=2c44be0e-4c60-4fa1-b251-18da756a8927)
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.