Skip to main content
Skip table of contents

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

How does this work?

Requirements

Configuration

Automation rule

For this use case, you can create a Jira Automation rule called Autofill Affects Versions:

image-20240515-171251.png

Trigger

The rule triggers when the Detected in field is updated:

image-20240515-170957.png

Condition

The rule only runs if the Affects versions field is empty, allowing users to overwrite the information if needed.

image-20240515-171429.png

Action 1: Send web request

To retrieve the environment ID(s) from the Detected in field:

image-20240515-171526.png
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):

CODE
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
Web request URL:
CODE
https://golive.apwide.net/api/environments/search/paginated
Custom data:
CODE
{
  "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
Version name:
CODE
{{webResponse.body.environments.deployment.versionName}}

Action 4: Edit issue fields

Update the Affects versions field with the retrieved version information:

image-20240515-173149.png
Affects versions:
CODE
{{webResponse.body.environments.deployment.versionName}}
Additional fields:
CODE
{
    "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.

JavaScript errors detected

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

If this problem persists, please contact our support.