Forums

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

How to validate more than one conditions using JMWE

Rosana Casilli
Contributor
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

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
Contributor
August 24, 2021

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

Suggest an answer

Log in or Sign up to answer