How to prevent transition if certain user is listed in custom user picker field

I have two custom user picker fields, "Defect Owner" and "Assisted" and both default to user "sfederman" when an issue is created. I need to create a rule that prevents users from progressing the ticket if sfederman is still listed in this field. 

3 answers

Create a validator. You can do that with various plugins (mine is JJUPIN, but you can use ScriptRunner, etc).

  1. Install the Scriptrunner plugin, if that's not already done. It's free, and extremely useful for any sort of advanced configurations.
  2. Add a Script Condition (or Script Validator) to your workflow transition(s) out of the initial status, or in any transition you want this rule to apply. A Condition would make the transition unavailable unless the conditions are met, the Validator makes the transition available, but would give an error message when attempting it without the condition being met. Your call.
  3. Several examples are provided. Your own condition would look like cfValues['Assisted']?.value != 'sfederman'

Have fun!

So i scripted this as a validator but it doesn't seem to be working. The issue transitions just as it normally would.

The Scriptrunner documentation may be of a better help. I must admit I haven't used the scripted rules much, and I'm not knowledgeable in Groovy. There might be a simple syntax mistake in what I gave you. I based my suggestion on the examples given.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

20,418 views 2 7
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you