Forums

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

JMWE - Conditional Execution - run if field does not include a phrase

Stephen Dyball November 1, 2023

Hello!

 

I am trying to setup a conditional execution on a post-function based on a field NOT containing a certain phrase. I have figured out how to do the opposite of what I want -  typical! This is shown below:

{{ issue.fields.customfield_10227.includes("Resolution Summary:") }}

Is there a way I can get the post-function to fire if the result value is false? Or make a change in the above template so that it will fire if the phrase is not present?

So far, I have tried using .!includes / .includes(!("Resolution Summary:")) and basically anywhere else I can put an exclamation mark.

 

I'm pretty fresh in the world of Jira & JMWE - so I appreciate any help I can get!


Kind Regards,

Ste

1 answer

1 accepted

1 vote
Answer accepted
David Fischer
Community Champion
November 1, 2023

Hi @Stephen Dyball ,

you can do this:

{{ not issue.fields.customfield_10227.includes("Resolution Summary:") }}

Be aware, though, that this comparison is case-sensitive. If you want a case-insensitive comparison, you can do:

{{ not issue.fields.customfield_10227.toLowerCase().includes("resolution summary:") }} 
Stephen Dyball November 6, 2023

@David Fischer Thank you so much for this - Works perfectly!

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