Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Help on ScriptRunner validator where reporter is not approver

We do not want ticket creator/reporter to be able to add themselves as approver in the "Approvers" user picker(multiple users) field in JSM.

I checked somewhere that this could be possible using a scriptrunner validator in the create transition but I am not sure how to write the script.

I tried using the script below but it failed.

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


1 answer

0 votes
Ivan Lima Community Leader Nov 21, 2021

Hi, @Fernando Jr_ Jeno, you can try something like the following snippet:

issue?.customfield_10003?.filter(a => a.accountId == issue.reporter.accountId)[0]?.accountId != issue.reporter.accountId

Replace the  customfield_10003 with your Approvers' custom field ID. I'm sure there are better ways to code this, but you can give it a try. It should work.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM Jira Automation: How to Send SLA Breached Notifications

Hi Everyone, In   this tutorial,  we will show you how you can monitor an SLA, and send notifications before or after the SLA has been breached.   SLA Threshold Trigger The SLA t...

653 views 5 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you