I am using Script runner plugin version 2.1.15, I have written a validation snippet which is working fine when I use the name of the custom field and not the ID, but I don't want my script to be tightly coupled with the custom field name
cfValues['Release'].getValue() == 'True
cfValues['customfield_12345'].getValue() == 'True'
is not, any suggestions?
Hi @Jamie Echlin [Adaptavist] - My full statement involves multiple fields - issue.issueTypeObject.name != 'XYZ' || (issue.issueTypeObject.name == 'ABC' && cfValues['Release'].getValue() == 'True' && cfValues['myField'] && cfValues["myNewField''] && cfValues['MyFieldtwo']?.value?.size() > 0)
thanks for sharing more info about it, as my requirement involved writing a long validation statement consiting of a certain scenario involving multiple custom fields and I wanted to restrict it to a single line of code but since cfValues doesn't work well with IDs thus would need to extract the IDs before hand.
Hi @Sana Safai - Yes, ofcourse it would have an impact on the sytax based on the type of my custom field but I currently not concerned with that rather I am looking for a way to get the custom field values based on their ID instead of names in a long condition statement, see my comment in response to Jamie answer's. thanks
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...
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!
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