Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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
4,553,397
Community Members
 
Community Events
184
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.

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 30, 2020 • edited

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.

custom_field.png 

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.

configure_1.png

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

 

set_approver_field.png 

 

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.

 

validator_config.png

 

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

validation_create.png

 

 

Hope this helps :)

Thank you, Ram.

 

But I achieved this through JMWE plugin validator.

Yogesh Mude
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.
Sep 02, 2020

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

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 02, 2020

Hi Yogesh,

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

Yogesh Mude
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.
Sep 03, 2020

Nope its not working

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 05, 2020

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.

add_custom_field_for_sd.png

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

add_fields.png

 

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.

configure_validator_1.png

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.

test_1.png

 

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.

test_2.png

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.

Capture.PNG

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events