Forums

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

Jira smart values logical statement with dates

Craig Easton
Contributor
November 22, 2022

Hi,

For context, I am trying to send a list of issues to Slack that have been in development for more than a week without a comment. The list of issues that have been in development for more than a week is quite easy, the comment part I am close but can't seem to finalize it.

 

I am attempting to use a logical statement within the lookup and can't seem to get the formatting right, currently what I have is:

{{#lookupIssues}}
{{#if({{comments.last.created.plusDays(7).compareTo(now)}})}}
YES #1
{{//}}
{{//}}

 

It complains:

Closing tag (/) does not match opening tag (if({{comments.last.created.plusDays(7).compareTo(now)):
I've tried a few fixes but none seem to resolve it.

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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 Leaders.
November 22, 2022

Hi @Craig Easton 

First thing, try using a single slash to close expressions like iterators and logical conditions: {{/}}

Second, when inside of a conditional test, you do not need the extra curly brackets for the issue fields.

Next, I believe that compareTo() returns -1, 1, or 0: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

Finally, to test in the conditional, I believe you need to use something like equals() test for this:

{{#lookupIssues}}
{{#if(equals(comments.last.created.plusDays(7).compareTo(now),1))}}
here is the key of a found item: {{key}}
{{/}}
{{/}}

 

Another idea: what do you mean by "in development" for this?  It seems you are instead checking for things with the last comment date/time rather than, for example, in progress.  Without seeing your entire rule and the JQL used for the Lookup Issues it is difficult to discern.

Kind regards,
Bill

Craig Easton
Contributor
November 24, 2022

Hey @Bill Sheboy thank you again, your assistance solved the problem for me!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer