Forums

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

Automation error message for Data Format

Yaniv June 4, 2024 edited

On Cloud I have an automation to update Parent Target Start & End date according to their children.

The condition is passes but the Edit issue part is fails with this error message:

"Key-57 (The Target end must be of the format "yyyy-MM-dd" (customfield_10023), The Target start must be of the format "yyyy-MM-dd" (customfield_10022))."

 

Here is my date format settings in Admin

Date-Time Formats.jpg

Here is the way the date value is displayed on an issue:

Date Field.jpg

And this is the JSON I have under the Edit Issue block of the automation:

{
"fields": {
"Target Start": "{{llookupissues.Target Start.min}}",
"Target End": "{{llookupissues.Target End.max}}"

}
}

How can I fix it?

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2024

Hi @Yaniv 

First, there are typographical errors in your smart values for {{lookupIssues}} references.  Smart values are name, spacing, and case-sensitive.  Incorrect values are returned as null.

Next, that error message tells you the values are in the incorrect format, and must be passed exactly as "yyyy-MM-dd" but passing just the date values sends them in a longer format.  

You may use the jiraDate format, as described here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---

For example, please try this:

{
"fields": {
"Target start" : "{{lookupIssues.Target start.min.jiraDate}}",
"Target end" : "{{lookupIssues.Target end.max.jiraDate}}"
}
}

Kind regards,
Bill

Yaniv June 4, 2024

Thanks @Bill Sheboy . I made the changes and added the "jiraDate" but still having same error. Even when I tried the option of format("<pattern>") it doesn't work. 

{
"fields": {
"Target start" : "{{lookupIssues.Target start.min.format("yyyy-MM-dd")}}",
"Target end" : "{{lookupIssues.Target end.max.format("yyyy-MM-dd")}}"
}
}

 

Yaniv June 4, 2024

OK after some diggings I noticed one of your answers in another post where the solution was to force the type of the field using toDate .

 Here is my final code:

{
"fields": {
"customfield_10022" : "{{lookupIssues.customfield_10022.toDate.min.jiraDate}}",
"customfield_10023" : "{{lookupIssues.customfield_10023.toDate.max.jiraDate}}"
}
}

 

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2024

Yes, that seems correct.  Some of the "date" fields are text, or appear as text, inside of rules and must be converted first.  I believe this applies to the Advanced Roadmap fields, in general.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events