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!

2 answers

1 accepted

2 votes
Answer accepted
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

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 8, 2026

Thanks so much Florian - that really helped. 

This is what I ended up with, which worked:

let userPickerValue = issue?.customfield_10869 != null

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

    : null;

return userPickerValue.groups.includes('X') || userPickerValue.groups.includes('Y') ||

       user.groups.includes('X') || user.groups.includes('Y')

 

Thanks again!

2 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
June 7, 2026

Hi @Neil Arrowsmith

I would suggest taking a look at the ScriptRunner Migration Suite . It has a built-in AI and is very helpful with workflow expressions for Validators and Conditions.

Thank you and Kind regards,
Ram

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 8, 2026

Hi Ram - that was my first port of call. Unfortunately it didn't help - from memory I think it only solved the "user performing the transition is in user group X" part, and couldn't help me work out the user picker group membership in the way that Florian did in the other reply.

Thanks for replying though.

Kh_Safal
Moderator
June 8, 2026

@Ram Kumar Aravindakshan _Adaptavist_, if you're part of a Marketplace App team, we would like to ask you to follow the steps outlined here to get an 'Atlassian Partner' lozenge for your profile and that you also include text in your comment stating you work for the company that built the app, per our Partner Rules of Engagement.

Thanks!

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