Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA Automation: how to detect when a version is renamed

Amy Chan August 2, 2022

I want to make a rule that monitors when the "next release" version is renamed to something else, and if so, creates a new version called "next release".

The trigger is on "Version updated", and the action is to "Create a new version".

However, I only want this to trigger if the version that triggered the automation was the "next release" version. i.e. the **old** name of the version was "next release".

The version filter in the "version updated" condition seems to filter on the **new** name of the version, not the old one.

I have also tried to use `fieldChange.fromString` and `fieldChange.toString` (I have logged this out while renaming a version to see what happens) but both are empty.

Is there a way to achieve this?

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2022

Hi @Amy Chan 

Short answer: I do not believe that is possible with the built-in features of automation.

More info...

There is an open suggestion describing the Jira changelog does not work well with automation rules for Component and Versions: https://jira.atlassian.com/browse/JSWCLOUD-22815  I could not find a specific suggestion or defect on this symptom for the Version Updated trigger.

There also is no action to edit a version yet: https://codebarrel.atlassian.net/browse/AUT-702

One possible (although complicated) work-around would be to modify your usage and rule, perhaps adding a prefix when changing the name (e.g. "next release: here's the new name") and then using the REST API to edit the version's name.  To me, that seems like more trouble than just renaming the version and adding a new one.

Kind regards,
Bill

Amy Chan August 2, 2022

Thanks Bill,

Changelog works for a changed issue, which isn't my use case (I want mine to trigger when the "next release" version is renamed to something else, and create a new "next release" version automatically - we use it as a placeholder). I don't need to edit an existing version.

It seems that `fieldChange` mustn't work for changed versions either despite Jira saying it will work "anywhere where smart values can be used".

For now the automation simply makes a "next release" version any time any version is updated in any way. If "next release" already exists the automation just fails which is good enough. The automation just has many false positives is all!

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2022

Sounds like a good work-around.  I recommend letting your site admin know in case they see the number of errors increase in the global audit log.

By changelog, I was referring to Jira's change history and not just the smart value.  The changelog and fieldChange smart values only appear to work with issue data currently, and not other entities like Components and Versions, stand-alone.  Hopefully that will improve to help with rules like yours.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events