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.
Community moderators have prevented the ability to post new answers.
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)}}
For Jira Data Center, you can use the following instead:
{{JanOneSeventy.toDate("dd/MM/yyyy").plusSeconds(number(AugustSixTwentyFour))}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.