The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How do I convert an Asset Object DateTime field for use in an Issue DateTime field?

Ian Maur
June 6, 2023

TL:DR - Attempting to format Asset Object DateTime fields via Automation outputs an empty value.


The Long Version

I am using global automation to create issues based on objects in Assets, and one of the fields I'm trying to populate when creating the issue is a DateTime field. Specifically, I'm trying to capture a "Contract End Date" Asset DateTime field in an object and add it to a custom DateTime issue field called "Scheduled Date/Time". 

Originally, in the create issue action, I was using this smartvalue:

{{system."Active Contract"."Contract End Date"}}

In this example:

  • "system" is the asset object that I'm using to create the issue.
  • "Active Contract" is the asset object with the DateTime field I'm trying to use.
  • "Contract End Date" is the DateTime field.
  • The Issue field I'm trying to populate is a DateTime field called "Scheduled Date/Time"

When I ran this, I got the following error in the automation audit log:

Check the format of Scheduled Date/Time (customfield_10087)

So I figure I'd add a format to the smartvalue that I'm using to populate it. Based on the documentation here (Jira smart values - date and time | Cloud automation Cloud | Atlassian Support) I appended a ".jiraDateTime" to the end of my smartvalue:

{{system."Active Contract"."Contract End Date".jiraDateTime}}

This got the automation to work successfully, but as it turns out, it's because the smartvalue above didn't post any value at all. I was curious if the formatting was just odd in Assets, so I tried adding a .toDate function prior to .jiraDateTime:

{{system."Active Contract"."Contract End Date".toDate.jiraDateTime}}

This achieved the same result as just using .jiraDateTime

To make sure I wasn't doing something odd, I disabled the issue creation and started sending myself emails with the outputs instead. I even used other formats, such as .shortDateTime/.longDateTime/etc., with and without .toDate, but in every instance, I didn't get an output.

Where I did get in output was without the formatting appended: {{system."Active Contract"."Contract End Date"}} - This output successfully in the email as "dd/MMM/yy h:mm a", however, this is the value that triggered a format error in my automation.


With that all being said, there are other things I could try, but I feel like I'm missing something obvious. If anyone has any suggestions, I'd appreciate the assistance.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events