Forums

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

How to block transition when two user pickers are same

Lily Wang October 22, 2021

Hi, 

 

I want to block the transition when the two user picker fields are same. But the jira expression seems always be wrong.

 

issue.customfield_12702[0].accountId != issue.assignee.accountId

It will always show this:

Message:

Evaluation failed: "issue.assignee.accountId" - Unrecognized property of `issue.assignee`: "accountId" ('accountId'). Type null does not have any properties

Can anyone help me ? 

 

Tks in advance.

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
October 25, 2021

Hi @Lily Wang ,

what is the type of custom field customfield_12702? Single or multi-user picker?

If it's a Multi-user picker, then the right expression is:

!issue.assignee || !issue.customfield_12702 || !issue.customfield_12702.some(it => it.accountId == issue.assignee.accountId)

If it's a Single-user picker, then the right expression is:

!issue.assignee || !issue.customfield_12702 || issue.customfield_12702.accountId != issue.assignee.accountId
0 votes
John Funk
Community Champion
October 22, 2021

Hi Lily,

Where are you trying to execute the code? 

Lily Wang October 24, 2021

Hi, John:

 

I just use the validator.

Build-your-own (scripted) Validator (JMWE app)

John Funk
Community Champion
October 25, 2021

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events