Version Autofill
Use Case
Sometimes, it may be challenging to remember what version is deployed on the Environment where you are performing your tests. Golive helps you track what version is deployed on each Environment, but what if it could automatically fill your "Affects Version/s" Jira field?

"Affects Version/s" field is prefilled based on "Environmen(s)" field selection
Have you managed to reproduce the bug on several Environments? Select them all and all versions will be prefilled accordingly:
.png%3Falt=media?inst-v=98c02b96-b9ab-4a69-851e-cdc353ecc161)
Selecting several Environments can autofill several versions
Configure your Automation
Prerequisites
You have configured your Golive Environments and filled the deployed versions
You have created an Environment Custom Field and add it to your Bug screen
Configuration
For this use case, we use the ScriptRunner Jira App. In ScriptRunner, create a new Behaviour and map it with the relevant Jira issue types:
.png%3Falt=media?inst-v=98c02b96-b9ab-4a69-851e-cdc353ecc161)
ScriptRunner Behaviour configuration
Then, add a server-side script for your Golive Environment Custom Field:
.png%3Falt=media?inst-v=98c02b96-b9ab-4a69-851e-cdc353ecc161)
import com.atlassian.jira.issue.customfields.CustomFieldType
// Get the list of Environments' IDs from the Environment CF
def envField = getFieldByName("Environment(s)")
List<String> envIds = envField ? (List) envField.getValue() : null
// Get the list of versions deployed on selected Environments
CustomFieldType environmentCustomFieldType = customFieldManager.getCustomFieldType('com.holydev.env.plugin.jira-holydev-env-plugin:holydev_environment_customfield')
List deployedVersionNames = envIds.collect { envId ->
environmentCustomFieldType.getSingularObjectFromString(envId).getDeployedVersionName()
}
// Update the "Affects Version/s" field with the deployed versions
def versionField = getFieldById("versions")
versionField.setFormValue(deployedVersionNames)
Questions?
The setup may be a little complex for Jira beginners, that’s why we offer free assistance for this configuration. If you need our help, contact us.