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
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
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot