Hi,
I would like some help to create a validator on a transition screen.
When an issue type is support, a priority will need to be selected.
The currently values of the priorities are P1, P2, P3 P4 and N/A.
Is there to validate (for the issue type 'Support Request' only. That N/A cannot be selected?
I tried using this method from the simple scripted validator but it still passes when selecting N/A.
issue.issueType.name == 'Support Request' && issue.priority?.name != 'NA' || issue.issueType.name == 'Incident'
Any ideas?
Cheers,
Jason
Hi @Jason Galea
Could it be as simple as a typo between the priority value of "N/A" and the the script using "NA"?
Other than that, your simple scripted validator seems fine.
To test it, go to the scriptrunner console and add try the following (put an issue key with priority is NA)
import com.atlassian.jira.component.ComponentAccessor
def issue = ComponentAccessor.issueManager.getIssueObject('JSP-4500')
issue.priority.name
When it runs, you will see the exact value that you should compare.
Then you can add your simple scripted validator script line before that and see what it returns and try a few different combinations.
Good one Peter-Dave! it was supposed to be set as "N/A"
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.