Hi,
I'm trying to create a simple automation based on due dates.
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? :)
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.