Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

In Service Desk Reporter is not the Approver/Reviewer

I'm looking at adding Approvals to my workflow. I DO NOT want the ticket reporter/creator to be the approver/Reviewer. What is the most efficient way to accomplish this?

Now the person that has entered the request (reporter), should not be the approver/Reviewer. In case they are the same, the request should not go to the approver.
The approvers are listed and chosen from a custom field (single select).

What is the groovy code/JSU/JMEW to create this validator?

1 answer

Hi @Thomas Schlegel , @JamieA 

How to achieve this via Script Runner Custom Validator? Could you please help me on this.

I achieved this through the JMWE plugin validator groovy script on the required transition.

Hi @Andrews 

Apologies for delay in response.

Script Runner's validator is able to handle this.

You will need to do some configuration as well.

1) Add a custom field -  for example a Single User Picker.  The Print Screen Below I've added the Approver field which is a Single User Picker.


2) Configure the workflow and set the approver.  In the print screen below, I'm choosing a In Progress and setting the Add Approval option.


3) Next select the configuration and set the field in which you want to display the approvers. 




4) Once that is done, you will need to add a new validator into the transition.   To add the validator,  select Script Validator [ScriptRunner] -> Simple Scripted Validator


Below is a sample code that I have used

issue.reporter.username != cfValues["Approver"].username


The field that I am setting this for is the Approver field.  Below is a print screen of my configuration.




So now, when I create a new issue for this project, if the Reporter and Approver are the same, the ticket will return a message and cannot be created.


Below is a print screen of the validation




Hope this helps :)

Thank you, Ram.


But I achieved this through JMWE plugin validator.

@Ram Kumar Aravindakshan _Adaptavist_  Will this solution work on JSD portal??

Hi Yogesh,

To answer your question, yes it should work the same in the JSD portal.

Nope its not working

Hi @Yogesh Mude 

I have tested this on the JSD portal and it does work.  The only difference is the display of the error message. 

You will, however, need to make some changes to your configuration.

Go to the project.
1) Select the project's cog.
2) Next, select Request types.
3) Either add a new Request type or modify your existing Request type as shown below.


Make sure that the field you want to use is included in the Request Type as shown below:-



Next, you will need to modify the workflow slightly.

As shown in the print screen below, you will need to add a validator for the create transition.


You can use the same example I provided in my earlier comment i.e.

issue.reporter.username != cfValues["Approver"].username


Once this is done you can start to test it. 

1) First login as shown below and select the project you want to use. In the example below I am logging in as an Admin user.



2) Next, create a sample ticket and select the approver as the same user you log in as.  In the print screen below, I have logged in as the Admin, and I have also selected the Admin as the approver.  When I try to create the ticket, the Error message is displayed.


3) Next, I try to create the ticket once again, but this time instead of selecting the Admin (logged in user) as the approver I have selected another user test_3.png

4) The ticket is created successfullytest_4.png

Hope this helps to answer your question :)

Hi @Ram Kumar Aravindakshan _Adaptavist_ 

I have tried your solution and steps above but it still does not work for me. 

We have an "Approvers" field which is a user picker (multiple users). And I tried to insert this script as mentioned in your steps:

issue.reporter.username != cfValues["Approvers"].username

However during testing, it still does not work.


Suggest an answer

Log in or Sign up to answer

Atlassian Community Events