The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to validate more than one conditions using JMWE

Rosana Casilli
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.
August 23, 2021

Hello all!!!

I have problems  using JMWE.. 

I want to add a condition where the  Components should be "Homologación" and Labels should be "MT" in order to transition to next status. 

 

I found in documentation the following expression

 

{{ issue.fields["Labels"] | find("MT") != null }} btu when testing tit from JMWE  it shows me the following error

 

There was an error during the execution of your Jira expression

Message:
Jira expression failed to parse: line 1, column 2:
IDENTIFIER or } expected, { encountered.

 

What should I change? and If I want to add a second condition which is the and operator used?

Thanks in advance

Ro

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
David Fischer
Community Champion
August 23, 2021

Hi @Rosana Casilli 

the syntax is actually described on the "Issue Fields" help tab at the bottom of the editor. The syntax for Conditions and Validators is different from that of Post functions.

In your case, you want this:

!!issue.components && issue.components.some(it => it.name == "Homologación") && !!issue.labels && issue.labels.includes("MT")
Rosana Casilli
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.
August 24, 2021

thank you so much @David Fischer  after sending the question I have found the answer