Restrict workflow state transition "Current User != Reporter"

Kevin May 13, 2013

Hi fellow JIRA lovers,

Hope you can help me on this one:

I’m currently implementing a very simple review process using workflow. User logs an issue, submits for review and someone from the reviewers group (assigned to a fake user to mimic a group) will be able to push the issue to the next workflow step. This is all working fine however, reviewers are also allowed to log issues and I want to force a peer review.

The rule is quite simple: Current user != Reporter -> Disable button or even better raise an error.

My question is; what would be the best way of getting this implemented?

Thanks,
Kevin

6 answers

1 accepted

1 vote
Answer accepted
Bhushan Nagaraj
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.
May 13, 2013

If you want to disable a button, you need to use a condition.

If you want to throw an error, you need to use a validator.

There is no built in validator to do what you are looking for. You can easily write a validator plugin, or use the script runner plugin.

Kevin May 13, 2013

Many thanks Bhushan.

Was hoping that this could be configured but just overseeing the possible option.

Will have to start reading up on how to build a validator plugin.

Kevin
Bhushan Nagaraj
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.
May 13, 2013

Give me 10 minutes I might have something for you

Dhruv Shah July 10, 2020

How can I limit the usage of Transition Buttons to only once? Any specific steps I need to follow?

1 vote
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 16, 2017

Hey everyone,

For anyone that finds this post today, the plugin posted by Bhushan no longer appears to be updated or compatible with Jira.

I found a free plugin for Jira Server on marketplace that can be used to do this.

You could install the Workflow Enhancer for Jira.  This plugin allows you create a condition type called "Universal Condition".  When you select this and choose Add, you can then configure this condition.

You can then enter a syntax such as:

{Reporter} != [user]

and then set the expression must evaluate to True.   This way if the reporter is also the user that is currently looking at this issue, they cannot make this transition.

Kevin Ultsh January 21, 2020

Thanks so much for this. Saved me tons of time. 

Like Andy Heinzer likes this
1 vote
Bhushan Nagaraj
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.
May 13, 2013

Hi Kevin,

Uploaded the plugin for you. It is available at

https://bitbucket.org/bhushan154/not-reporter-workflow-plugin/overview

Documentation available at

https://bitbucket.org/bhushan154/not-reporter-workflow-plugin/wiki/Home

I haven't tested it yet and don't think I will be able to do it today. Try it out and let me know if you have any issues.

https://bitbucket.org/bhushan154/not-reporter-workflow-plugin/issues?status=new&status=open

Brian Jones March 31, 2014

Thanks so much for this! I was looking for something to do this exact thing and stumbled across this page.

0 votes
Ramin Ghanbari April 16, 2018

Hi,

This add-on does the job as well.

adaptavist ScriptRunner for JIRA

Just need to add the following condition to the transition:

1.PNG2.PNG

0 votes
srinivasa_pudi August 3, 2014

the above mentioned plugin is not at all working , Please help

0 votes
Bhushan Nagaraj
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.
May 13, 2013

Hi Kevin,

You need to use a workflow condition.

Add a condition which allows only the Reporter of the issue to perform the transition.

1. Go to Administration click on Workflows

2. Choose the workflow you want to edit

3. Click on the Transition you would like to apply the condition to

4. Click on Conditions and select Add

5. Select "Only Reporter Condition"

Documentation available at

https://confluence.atlassian.com/display/JIRA/Configuring+Workflow#ConfiguringWorkflow-conditions

Kevin May 13, 2013

Thanks Bhushan.

Unfortunately, I made a mistake within my title. It should be in “negative”.

  • Current user = Reporter -> Disable button or even better raise an error.

Kind regards,
Kevin

Suggest an answer

Log in or Sign up to answer