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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.