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:
Here what my automation looks like:
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!
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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")}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.