Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira expression for validator checking user and user picker against group memberships

Neil Arrowsmith
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 Champions.
June 5, 2026

I'd like to write a Jira expression for use in a validator that checks if any of the following are true:

  1. The user performing the transition is in user group X
  2. The user performing the transition is in user group Y
  3. The user selected in user picker field customfield_10869 is in group X
  4. The user selected in user picker field customfield_10869 is in group Y

 

If any of these are true, the validator should allow the transition to happen. This is on the create transition in particular, so the issue should be created.

I've tried:

issue.customfield_10869.groups.includes('Account Managers') 

But get an error "Unrecognized property of `issue.customfield_10869.groups`: "includes""

I'm trying to create the validator using Scriptrunner.

Thanks!

1 answer

0 votes
Florian Bonniec
Community Champion
June 5, 2026

Hi @Neil Arrowsmith 

 

I think it's because issue.customfield_10869 return a Map not a user Object.

You need to get the User object from the accountID property in the Map.

Something like 

let userPickerValue = issue?.customfield_10869 != null

    ? new User(issue?.customfield_10869?.accountId)

    : null;

Then you can do userPickerValue.groups

Regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events