I am trying to validate that when an issue is type "Bug", whether Priority field is set to "None".
In the Script Runner simple scripted validator, if I put one of these conditions, they work as expected:
However, if I try to combine them, it doesn't work.
What is the correct syntax to combine them?
Community moderators have prevented the ability to post new answers.
Did you try validating it as not null?
issue.priority?.name != null && issue.issueType.name == 'Bug'
Thanks for the response Niclas.
The Priority field in JIRA is a system field. It cannot be set to null. That is why we added a value called "None". Only custom fields can have a null value.
I was able to figure it out though. The validator needed to be:
issue.issueTypeObject.name != 'Bug' || (issue.issueTypeObject.name == 'Bug' && issue.priority?.name != 'None')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.