Smart value for not and equals operator not working

Amit Bansal
Contributor
November 17, 2023

Team - I am trying to create an automation rule to print all sprint items however would like to ignore all issue types with status as "Cancelled" and "Invalid". Below is the query but it is not working. Any help would be greatly appreciated!

 

{{#lookupIssues}}
{{#if(not(equals(issue.status.name,"CANCELLED")))}}
{{issueType.name}} - <{{url}}|{{key}}> - _{{summary}}_ {{status.name}} is due on {{dueDate}}.
{{/}}
{{/}}

3 answers

1 accepted

4 votes
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2023

Hi @Amit Bansal ,

please try status (or status.name) instead of issue.status.name in the condition.

See here for more info:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2023

Hi @Amit Bansal ,

I've just tested it and it works for me:

{{#lookupIssues}}
{{#if(not(equals(status.name,"New")))}}
{{status.name}}
{{/}}
{{/}}

The problem could be in the status name - CANCELLED is not the same as Cancelled. So if your status is called Cancelled (not CANCELLED), your condition won't work.

Maybe it will be the best to use status.id in the condition instead of name.

Amit Bansal
Contributor
November 17, 2023

It worked. Thank you so much.

0 votes
Amit Bansal
Contributor
November 17, 2023

Hana - While I am trying to use "and" operator, it is giving me an error (row 2). Would be of big help if you know the fix.

 

{{#lookupIssues}}
{{#if(not(equals(and(status.name,"Cancelled"),(status.name,"Invalid"))))}}
{{issueType.name}} - <{{url}}|{{key}}> - _{{summary}}_ {{status.name}} is due on {{dueDate}}.
{{/}}
{{/}}

 

Thanks,

Amit

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2023

Hi @Amit Bansal ,

please try:

{{#if(and(not(equals(status.name,"Cancelled")),not(equals(status.name,"Invalid"))))}}
Like Bill Sheboy likes this
Amit Bansal
Contributor
November 17, 2023

It worked...Thanks a ton.

Like Hana Kučerová likes this
0 votes
Amit Bansal
Contributor
November 17, 2023

Thanks Hana....Tried it too earlier but it also did not work.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events