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$ )

 

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