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