Forums

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

Convert string to date/time field is not working

Kaja Iske
Contributor
March 24, 2026

I would like to use automation to convert a string in the description into a date/time field. My description contains only the date and time in the following format: yyyy-MM-ddTHH:mm. There is nothing before or after it.

For example: 2026-03-09T18:34

I tried to get this string into my date/time field via Edit Issue using the following Smart Value: {{issue.description.toDate(“yyyy-MM-dd'T'HH:mm”)}}

Unfortunately, I don’t get any result. It simply doesn’t transfer anything to the field. However, if I insert a Log Action before it, I do get a result in the log.
Test: {{issue.description.toDate(“yyyy-MM-dd'T'HH:mm”)}}
Test: 2026-03-09T18:34:00.0+0000

Can someone tell me where I'm going wrong?

2 answers

1 accepted

4 votes
Answer accepted
Nikola Perisic
Community Champion
March 24, 2026

Hello @Kaja Iske 

You are actually pretty close! You should include a small change with your smart value:

{{issue.description.toDate("yyyy-MM-dd'T'HH:mm").format("yyyy-MM-dd'T'HH:mm:ss.SSSZ")}}
Kaja Iske
Contributor
March 24, 2026

Hi Nikola,

thanks for the hint! In principle, that works, but it then shifts the time back by an hour (19:34).   Is there another solution?

Nikola Perisic
Community Champion
March 24, 2026

@Kaja Iske  What time zone is this?

Kaja Iske
Contributor
March 24, 2026

@Nikola Perisic  GMT+01:00 (Europe/Vienna)

Nikola Perisic
Community Champion
March 24, 2026

@Kaja Iske 

Then you need to adjust your smart value to:

{{issue.description.toDate("yyyy-MM-dd'T'HH:mm").convertToTimeZone("Europe/Vienna").jiraDateTime}}
Kaja Iske
Contributor
March 24, 2026

@Nikola Perisic Unfortunately, it's still the wrong time :(

Nikola Perisic
Community Champion
March 24, 2026

@Kaja Iske 

{{issue.description.toDate("yyyy-MM-dd'T'HH:mm").setTimeZone("Europe/Vienna").jiraDateTime}}
Kaja Iske
Contributor
March 24, 2026

@Nikola Perisic That's the solution :-)! Thank you so much!

1 vote
Jeroen Poismans
Community Champion
March 24, 2026

Hi,

So it seems you effectively get a date out of the conversion. Try using this:

{{issue.description.toDate(“yyyy-MM-dd'T'HH:mm”).jiraDateTime}}

or

{{issue.description.toDate(“yyyy-MM-dd'T'HH:mm”).jiraDate}}

Here is the resource where I found this:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

 

Kaja Iske
Contributor
March 24, 2026

Hi Jeroen,

thanks for your answer. Unfortunately, it only copies the date. By default, it sets the time to 1:00 a.m. 

Jeroen Poismans
Community Champion
March 24, 2026

Not if you pick the jiraDateTime option as mentioned above.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events