Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Automation error message for Data Format

Yaniv June 4, 2024

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
AUG Leaders

Atlassian Community Events