Forums

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

Need help combining and converting string values (stored as HH:mm:ss) with date value (yyyy-mm-dd)

Michael Catmur August 20, 2025
Need help combining and converting string values (stored as HH:mm:ss) with date value (yyyy-mm-dd)
  • I have a custom field (issue.customfield_11248) which is storing a string for time (StartTime). {format: string}
  • I have another custom field (issue.customfield_11124) which is storing a the date (StartDate). {format: date}
  • I have another two custom fields for EndTime and EndDate (issue.customfield_11250 and customfield_11125)
  • The mask for entering data into the string field is HH:mm:ss
I need to calculate the days, hours, minutes and seconds between start date/time and end date/time, in a Jira Service Desk automation, and to populate that value into another customfield for "duration"
As a first step I tried concatenating the time and date fields using:
{{issue.customfield_11124.concat("T").concat(issue.customfield_11248)}}
But this first step failed with:
"Unable to render smart values when executing this rule:
Too many numbers or variables: d h m s"
I'm not a developer, and stumped how to progress... can anyone shed any light/insight?
---
Update: 
The field I was trying to populate (StartDateTime_GMT_Concatenated) with the concatenated values was of the incorrect type. This has been changed to a string value. While I can populate StartDateTime_GMT_Concatenated with two strings, i can't populate it with a date + string. So need to figure out how to convert issue.customfield_11124 into a string

 

3 answers

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2025

Hi @Michael Catmur -- Welcome to the Atlassian Community!

For a question like this, context is important for the community to help.  Please post the following:

  • what version of Jira are you using: Cloud, Server, or Data Center
  • for Cloud, what type of project is this: company-managed, team-managed, JPD, etc.
  • an image of your complete automation rule in a single image for continuity
  • images of any relevant actions / conditions / branches
  • an image of the audit log details showing the rule execution
  • explain what is not working as expected and why you believe that to be the case

Until we see those...

 

Are you using the built-in Start Date and End Date fields, or did you create additional custom fields with the same names?

What are the types of your fields: text, date, or date / time?

 

Kind regards,
Bill

Michael Catmur August 20, 2025

Hi, thanks for the feedback: 

  • Jira Cloud
  • Company Managed project (service management)
  • Image of the Edit process step attachedaudit.jpgwflow.jpg
  • Image of audit log attached (same detail details as shared in original post in text)audit.jpg
  • In terms of what's not working... i think i've explained that already , but to give it another go-around: I am unable to figure out how to combine a time stored as text, with a date stored as a date, into a date/time in order to be able to use it later in a date calculation. 
  • I am using custom fields for the data and time
    • date (issue.customfield_11124) is stored as a date (and checking with postman it is being stored as yyyy-mm-dd)
    • time (issue.customfield_11248) is being stored as a string. the mask on the entry form ensures that the string format is HH:mm:ss (using regex ^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$ )

 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2025

Thanks for that information, @Michael Catmur 

Let's start with the most-likely possible causes...

Date value typing

You are concatenating a string to a date, and then trying to use that as a date / time.  Let's try helping the conversion a bit with forcing the first value explicitly to text before the concat() and then converting with a known format:

{{issue.customfield_11124.jiraDate.concat(" ").concat(issue.customfield_11248).toDate("yyyy-MM-dd HH:mm:ss")}}

 

Racetrack error

The Work Item Created trigger has a long-standing, racetrack timing problem. Specifically, the rule can start running before all of the data is available, or the item is even in a stable condition. This can appear as weird rule errors (e.g., permission problems, no issue type!, etc.) or conditions not matching as expected.

In the announcement for this advanced component feature, I asked the Atlassian team member about it and...they know about it, they are working on architectural changes to fix it, and there is no time frame for when this will be fixed.

Given that information, I have two recommendations:

  • As other triggers can have this racetrack timing problem, perhaps do not use that new feature to add conditions to triggers yet. I advise this because the audit log does not show why a rule did not trigger with this new feature (yet). This will conceal any problems of a work item did not match the condition versus a timing problem.
  • With the Work Item Created trigger, add the Re-fetch Work Item Data action immediately after the trigger, then followed by any conditions. This will slow the rule slightly, reloading the data before the steps proceed.

 

Please make those three changes and then retest your rule.  Thanks!

 

0 votes
Michael Catmur August 21, 2025

moved on a little now.. have managed to get a custom field StartDateTime_Concatenated (issue.customfield_11578) as a string using:

{{issue.customfield_11124.format("yyyy-MM-dd").concat("T").concat(issue.customfield_11248).concat("Z")}}

this is storing values like "2025-08-21T10:10:10Z" in a string field. 

Now i need to convert that ISO datetime  into a proper datetime value. I tried these: but get no value populated and no error message from the automation.  

  • {{issue.customfield_11578) | toDate}} and 
  • {{issue.customfield_11578 | toDate("yyyy-MM-dd'T'HH:mm:ssZ")}}

 

Any suggestions?

0 votes
Kim Euker
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!
August 20, 2025

While this won't solve your issue, it will help with what you are trying to do.

Change your statement to:

{{#Debug}}{{issue.customfield_11124.concat("T").concat(issue.customfield_11248)}}{{/}}

Then post the output here.  If you get an error, post each piece separately so that we can see your data

Michael Catmur August 20, 2025

Thanks, for that. I tried it, but unfortunately get no extra info in the audit log

audit2.jpg

Suggest an answer

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

Atlassian Community Events