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:
- date fields for start (JTU_DateGMT) and end (JTU_DateGMTEnd) dates and
- text fields for the time (using a mask to ensure the correct format) for start and end times (JTU_StartTimeofIncident_GMT, JTU_EndTimeofIncident_GMT).
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:
- if no end date, assume the end date is the same as the start date
- else, if there is an end date, use that value.
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

