Comment Validator Based On Fix Version Value - Simple Scripted Validator

We have a requirement where the user must be forced to enter a comment whenever there is a change in Fix Version Field. We are able to achieve this using following simple scripted validator

originalIssue.fixVersions == issue.fixVersions || transientVars["comment"]

However , this will force the user to enter the comment even though the value is entered for the  first time which is not what we are looking for.

It should not ask the user to input the comment if he is providing the value for the first time. It should only force the comment when the value is changed , (i.e value is changed from "Version1" to "Version2"   or "Version1" to "Version2 , Version3" etc but NOT from "None" to "Some Version")

Can you suggest any solution?

 

Note : We are working on "Transition Screen".

 

Thank you!

1 answer

You can try amending your condition to the following to capture null fixVersions.

originalIssue.fixVersions == null || originalIssue.fixVersions == issue.fixVersions || transientVars["comment"]


Hi @Phill Fox [Adaptavist] ,

 

Thanks for your inputs. I tried to implement your code but still no luck. It is still forcing to enter a comment even though the user is providing the input (for Fix Version field) for the first time , i.e changing Value from Null/Empty value to any other value/version.  Is there any other way to implement this functionality? 

 

Thank You

--Swathi

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Feb 15, 2018 in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

1,231 views 6 19
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot