Hi,
I have a Service Desk being used to record incidents where i need to record dates/times down to the second.
In order to achieve this, i have:
JTU_DateGMTEnd is deliberately options. Issues may be raised in advance of an issue being resolved.
To make duration calculations (when there is an end date), i concatenate the data and time strings to make a ISO time format.. so
JTU_StartDateTime_GMT_Concatenated = {{issue.JTU_DateGMT.format("yyyy-MM-dd").concat("T").concat(issue.JTU_StartTimeofIncident_GMT).concat(".000+0000")}}
...
However, for JTU_StartDateTime_GMT_Concatenated I need logic to do the following:
I'm trying to to user IF logic within the smart tag, for JTU_EndDateTime_GMT_Concatenated, but am struggling to get it to output any value.
My most recent attempt has this smart value setting:
"Test: {{#debug}}{{#if issue.JTU_DateGMTEnd}}{{issue.JTU_DateGMTEnd.format("yyyy-MM-dd").concat("T").concat(issue.JTU_EndTimeofIncident_GMT).concat(".000+0000")}}{{else}}{{issue.JTU_DateGMT.format("yyyy-MM-dd").concat("T").concat(issue.JTU_EndTimeofIncident_GMT).concat(".000+0000")}}{{/}}{{/debug}}"
absolutely nothing gets written in the debug message... so ...
a) if IF logic supported in smart tags like this, and
b) any pointers if i'm messing up the syntax/approach for the IF?
anything else, before i shoot myself :-)
Many thanks
---
Jira Cloud
Company managed project
Hi @Michael Catmur ,
Automation Smart Values support IF logic, found here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/
I would recommend potentially switching to use the built-in If / else blocks found within the Condition block. This would be helpful to allow you to do this if/else on the Jira field itself, and then simplify your automation rule and smart value calculation.
It also it a bit more maintainable having a more clear separation of actions.
Hope this helps!
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.