Accessing changed name in JIRA Automation for "Version Updated" trigger
Asked by Markus Hoofe:

Hello,

We would like to create an automation rule in JIRA to re-create a "symbolic" Release version, once the old one was renamed to an "actual" version.

E.g. we want to have an "UPCOMING_VERSION" Release to assign all issues to and then change the Release to e.g. 1.2.3, which should automatically create a new "UPCOMING_VERSION" Release to begin a new cycle.

We tried by using the "Version Updated" trigger, but the "Version name filter" only seems to match the NEW version name, not the previous one. Also, we tried using a "smart value condition", but we had no idea on how to access the previous name. We tried using some combinations with the "fieldChange" variable here as well, but that only seems to work with issues, not versions.

As a "workaround", we now simply re-create the UPCOMING_VERSION Release on any change, as this will not be done, if a Release with that name already exists. However, we are not sure if that might cause problems in the future.

We appreciate any help in advance!

Regards  
Markus


Answers:
author: Bill Sheboy
body: Hi [@Markus Hoofe](/t5/user/viewprofilepage/user-id/977913) -- Welcome to the Atlassian Community!

Short answer: Your workaround looks like a good approach.

More information...

The changelog entries do not work for that trigger, Version Updated. And even if they did, there are multiple events which can fire that trigger for rules...and some version updates which do not (e.g., changes to approvers, sections, etc.).

You could try to narrow down the scope to only "version updates" by using a system webhook and webhook triggered rule...but that would still not provide the "before" value for the version name.

Here are some related suggestions in the public backlog if you want to watch / vote for them:

* <https://jira.atlassian.com/browse/AUTO-615>
* <https://jira.atlassian.com/browse/AUTO-1228>  

**If you are concerned about potential errors re-creating the** **UPCOMING_VERSION entry**, you could use the Send Web Request action to call the REST API function, checking if the version already exists...and only create it when it does not exist. Here is some information if you want to try that addition:

* <https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828>
* <https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-project-projectidorkey-version-get>

Kind regards,  
Bill


author: Dick
body: Hi Markus,  
you might want to use the **change log** of an issue to access the previous value of the version:   

This has been described by [@Stephen Wright](/t5/user/viewprofilepage/user-id/1536160) in [this forum entry](https://community.atlassian.com/t5/Jira-questions/Automation-for-Jira-condition-when-value-change-on-custom-field/qaq-p/2665200).

comments: author: Markus Hoofe
body: Sorry, but "changelog" as well as "fieldChange" do not work when updating a version! At least these fields are always empty.

I guess they only work on "issue" but not on other objects like "version"!?


Tags: automation

cloud

jira-cloud

smart-value