Forums

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

Asset Date Format

Patricia Molina March 26, 2025

Hi Everyone, I am on Jira Data Center 9.12.17 with JSM.

I have assets that have a License End Date attribute. I have setup automation to send emails when they are about to expire. What is sent in the email is the following:

Name: Knowbe4
Description: `Knowbe4 Security Awareness training
License Start Date: 1712016000000
License End Date: 1743566400000

The dates are in the wrong format even though they show correctly in Assets:

asset.JPG

 

Here what my automation looks like:

automation.JPG

I have tried different smart values formatting like {{attributes.License End Date2.jiraDate}} or

 

 {{attributes.License End Date2.format("mm/dd/yyyy")}} and nothing seems to work.

Any help is appreciated!

2 answers

1 vote
Emmanuel Abwao March 26, 2025

Hello Patricia,

The issue here is that the License Start Date and License End Date values are being displayed as Unix timestamps. The reason {{attributes.License End Date2.format("mm/dd/yyyy")}} did not work correctly is due to Incorrect Format Specifier for Month. mm Represents minutes, not months.

Try this solution:
License Start Date: {{attributes.License Start Date.format("EEEE, MMMM dd, yyyy")}}
License End Date: {{attributes.License End Date2.format("EEEE, MMMM dd, yyyy")}}

Expected Output:
License Start Date: Tuesday, April 02, 2024
License End Date: Thursday, May 02, 2025

If you want the date format as 07/06/2025 (MM/dd/yyyy), use:
{{attributes.License End Date.format("MM/dd/yyyy")}}

Let me how it goes.

Patricia Molina March 31, 2025

Thank you for the response @Emmanuel Abwao. Unfortunately that did not work. Here is what I am seeing in the email:

The following software license is due to expire soon:

Name: Knowbe4
Description: `Knowbe4 Security Awareness training
License Start Date: 1712016000000
License End Date: MM/dd/yyyy1743552000000

Emmanuel Abwao March 31, 2025

Hello Patricia. If it is possible, you may attach the image of the attribute and the smart values you've inserted. The syntax might be a problem. Let me know as soon as you do.

Patricia Molina April 1, 2025

Hi @Emmanuel Abwao 

Here is my code:

I have tried this:
{{#lookupAssets}}
Name: {{attributes.Name}}
Description: {{attributes.Description}}
License Start Date: {{attributes.License Start Date}}
License End Date: {{attributes.License End Date.toDate("MM/dd/yyyy")}}
{{/}}

And here is the other one you told me to try:

{{#lookupAssets}}
Name: {{attributes.Name}}
Description: {{attributes.Description}}
License Start Date: {{attributes.License Start Date}}
License End Date: {{attributes.License End Date.format("MM/dd/yyyy")}}
{{/}}

0 votes
Rodney Estrada
Contributor
March 28, 2025

Great answer @Emmanuel Abwao . Do you happen to have a link for that?

I'd like to learn what else I can customize. Thank you,

Emmanuel Abwao March 28, 2025

Thanks Rodney,
For the customization of dates, use the java date pattern syntax. Here is an example:
Data and Time Format

To use them in relation to Atlassian's smart values like in assets above, you may want to read this:
Automation smart values - date and time | Cloud automation Cloud | Atlassian Support

I hope that helps.

Like Rodney Estrada likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events