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

Help on ScriptRunner validator where reporter is not approver

Fernando Jr_ Jeno November 18, 2021

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 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
TAGS
AUG Leaders

Atlassian Community Events