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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

402 views 1 18
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