Forums

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

Automation: using If statement in smart value for "Edit work item" step

Michael Catmur November 25, 2025

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

Untitled 2.pngUntitled 3.png

 

 

 

1 answer

0 votes
Robert DaSilva
Community Champion
November 25, 2025

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events