Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I copy a date from an assets object attribute over to a date field in a jira?

Richard Shepley July 31, 2023

Hi guys, I hope someone can help me.
I need to copy a date stored in an asset object over to a Jira date field.  
Using automation, I can look up the date from the object but when I try to copy it over to a Jira date field, I get the error that the format is not correct. The format returned from assets is example; "Fri Oct 24 00:00:00 UTC 2014" this cannot be copied to a Jira date field in this format. 
I have tried to use the "create a variable" without success, I have also tried copying the date to a text field, and then copying the value from the text field using the toDate function over to the due date field in Jira as described here, Solved: Pulling Insight date attribute into an issue (atlassian.com)

Nothing seems to work.

Has anyone worked out how to convert an asset date format into a usable date format in a jira date field? 

2 answers

1 accepted

0 votes
Answer accepted
Richard Shepley August 13, 2023

Looks like I didn't need the second variable, I just needed to add .toDate.jiraDate to my first create variable smart value as it was returned as a string. adding {{datevar.toDate.jiraDate}} converted the string to the correct usable jira date format. 

2023-08-01_16-49-03.jpg

2023-08-14_09-16-13.jpg

1 vote
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2023

@Richard Shepley -

Here is a possible idea is to create an automation rule where you can obtain the assets object's attribute and utilize the smart value for date format to convert it to a format for your JSM issue's custom date field -

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

I have not yet test it out, but it should work for you.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

Richard Shepley August 1, 2023

Hi Joeseph,
Thanks for the reply. I have tried just about every combination of smart fields to convert the date. 
What I have done in my automation is create a variable called datevar to look up the attribute "Acceptance date" 

2023-08-01_16-49-03.jpg

I then create an audit log action to confirm the date is pulled from assets. 

2023-08-01_16-50-34.jpg

I then create a second variable called datevartwo and add the smart value of {{datevar.mediumDate}} to convert the date to a format that can be used by the jira issue due date field.

I add another log action to log the output of datevartwo

2023-08-01_16-54-18.jpg

The audit log shows the datevar variable returns a date from assets as expected in the wrong Jira date format. datevartwo variable is empty so I can only assume Jira cannot convert the date format. This is where I am stuck. 


Result of audit log below 

As you can see the second log is empty
2023-08-01_16-55-16.jpg


Any ideas greatly appreciated. 

Mark Rabanal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 26, 2024

Hi @Richard Shepley did you get a resolution for this? Looking to do the same yet my challenge is doing in DC.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events