Forums

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

Jira automation - smart values conditional logic does not return true

Andreas Eichert
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 3, 2022

Hi,

I'm trying to create a simple automation based on due dates.

image.png

I have a smart variable dueInDays: 

{{#=}}{{now.diff(issue.dueDate).days}}+1{{/}}

 

I've tried several variants, but I cannot get the if-condition to return "Hello".

due in: {{dueInDays}}

{{#if(dueInDays.gt(0))}} Hello {{/}}

 

I was following the documentation here (numerical comparisons): https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

Any ideas? :)

2 answers

1 accepted

1 vote
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2022

Hi @Andreas Eichert 

Could you describe your use case from a functional perspective? As this could maybe be resolved with a condition component in automation rather than within smart value condition.

So condition could be checked up front and only in case of fullfillment mail is sent. 

Please let me know what exactly should happen when in order to find the best solution according to the requirement.

Best
Stefan

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2022

I also got the conditional smart value working. Please try following and let me know if it works for you too:

 

{{#if(dueInDays.asNumber.gt(0))}} Hello {{/}}

 

Best
Stefan

Like # people like this
Andreas Eichert
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 4, 2022

That solves it. Thanks a lot! 

I was also looking for casting to a number but could not find anything straight away.

And yes, it could probably be solved with a condition and just sending two different types of mails instead of formatting a mail.

 

Use case is sending reminders based on the due date. I want to send

"Your task is due tomorrow." instead of "Your task is due in 1 days.".

Like # people like this
0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2022

Hi @Andreas Eichert

Use the log action to see whether the first variable is set properly.  Instructions: https://support.atlassian.com/cloud-automation/docs/debug-an-automation-rule/

Regards

Suggest an answer

Log in or Sign up to answer