Forums

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

Converting from Unix time (secs since 1970) to a date using Jira Automation

Rodney Dsouza _Atlassian Certified Expert_
Contributor
August 5, 2024

I am integrating with an external system using Jira Automation.   That external system is returning date values in seconds-since-1970 e.g. Aug 6, 2024 is being returned as 1722906223

 

I have mulled over this a bit.   And tried various ideas but am a bit stumped as to how to actually make it work with Jira Automation.  Note that this is all within the context of getting data from another system and processing a list of items (so in Jira Automation terms, this is already within a branch).

While trying to write something with Jira Automation I was running into its limitations e.g. cannot use a variable within and expression,  cannot do math within an expression, etc.

If it makes any difference, I am putting the computed value into a JSM Assets object (not an Assets field either).  I am NOT dealing with Jira issues in this context.

 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Rodney Dsouza _Atlassian Certified Expert_
Contributor
August 5, 2024

Figured it out, I was doing one thing wrong.

The solution is simple-enough:

For testing/dev purposes assume value to be converted is in a variable named "AugustSixTwentyFour" with value of 1722906223  (Unix time for 6 Aug 2024)

 

Define a Variable "JanOneSeventy" with value "01/01/1970"

 

This should give the correct answer:

{{JanOneSeventy.toDate("dd/MM/yyyy").plusSeconds(AugustSixTwentyFour.asNumber)}}

 

Yang Qian
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 2026

For Jira Data Center, you can use the following instead:

 

{{JanOneSeventy.toDate("dd/MM/yyyy").plusSeconds(number(AugustSixTwentyFour))}}
Evie Z_
Community Manager
Community Managers are Atlassian Team members who specifically run and moderate Atlassian communities. Feel free to say hello!
January 9, 2026

This topic is now closed as the discussion has become outdated. If you have more questions or want to continue the conversation, feel free to start a new topic. For more details on why we close older threads, check out our Rules of engagement - Atlassian Community .

Thank you for your understanding!

DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events