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

Scott Federman September 2, 2015

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

0 votes
Scott Federman September 2, 2015

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

Nicolas Bourdages
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2015

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.

0 votes
Nicolas Bourdages
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2015
  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!

0 votes
Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2015

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

Suggest an answer

Log in or Sign up to answer