How do I use workflow validator to either write JQL or scriptRunner code to check for the following:
Only allow transition if:
if (custom_field1 == 'No' || (custom_field1 == 'yes' && custom_field2 != "")
give the popup warning if it doesn't meet the criteria above?
Thank you.
I think I figured it out and put it here in case someone will need it later:
cfValues['PR Required']?.getValue() == 'No' || (cfValues['PR Required']?.getValue() == 'Yes' && cfValues['Peer Reviewer(s)'] != null)
Hi @Kha Hoang
Go to you workflow, find the transition, go to validators, take the sciptrunner simple scripted validator. Put your string above in
custom_field1 == 'No' || (custom_field1 == 'yes' && custom_field2 != "null"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Craig,
Yes, it sounds very simple but that's what I did but the problem is that regardless I set field1 to Yes or No, it didn't let the issue transition forward to the next status. It means this condition somehow always false.
The actual code is this:
cfValues['PR Required'] == 'No' || (cfValues['PR Required'] == 'Yes' && cfValues['Peer Reviewer(s)'] != "null")
Thank you.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.