How to automatically adjust a task's target end date to the latest of its subtasks?

Marleen April 20, 2023

I need an automation that helps me set the Target end (customfield_12302) to the date of it's latest Sub-Task Target end.

 

Can someone help me please? I tried the following code, but it doesn't work:

{
  "fields": {
    "customfield_12302": "{{#issue.subtasks.max.Target end}}{{.}}{{/}}"
  }
}

1 answer

1 accepted

2 votes
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 20, 2023

Hi @Marleen Willing 

As far as I read it in the documentation there is no need to iterate over the list. The "max" method is available directly to the list (see link):
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#list.max

Try to add the following for customfield_12302 in your JSON:

{{issue.subtasks.Target end.max}}

 

Best
Stefan

Marleen April 20, 2023

Hi @Stefan Salzl

thank you for your quick response. Do you have an idea why the automation still does not work? Now it says: (Unparseable date: "" (customfield_12302))

It doesn't matter whether I use customfield_12302 or Target End. Both doesn't work.

2023-04-20 17_16_13-Desktop-Win2019 - Desktop Viewer.png

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2023

Hi @Marleen Willing ,

is there any special date format configured in you site? Could you try to output the format in a log action? this will write the date to the audit log so we can see the format. Just fill in any date into the parent‘s date field and write the cuustom field to audit log with a log action using {{issue.<your_customfield>}}

furthermore: Is there any special reason you are using the json edit type? Could you also try to choose the custom field from the fields dropdown and write the smart value used in your json into the field?

Best
Stefan

Like Marleen likes this
Marleen April 27, 2023

Hi @Stefan Salzl ,

thank you very much for your help. It worked! The problem was the different date formats.

Best regards

Marleen

Like Stefan Salzl likes this
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2023

Hi @Marleen Willing #

That´s awesome. Happy to know you got that working. Thanks for the feedback.

 

Best
Stefan

Suggest an answer

Log in or Sign up to answer