Forums

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

Update Target Start / End based on Sprint Dates

Louise Woods August 14, 2025

Hi, 

I am wanting to populate / update the Target Start & End Date on an Epic based on the stories / spikes / bugs based on the sprint dates earliest and latest date. 


So in the automation I can look up all tasks within the Epic and as starting point was adding it to the audit log to check it worked but the date is blank. 

Screenshot 2025-08-14 135031.png

Any advise or steps - please explain to me like I don't work in IT :-)

Thanks, 

Lou 

 

 

2 answers

1 vote
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.
August 14, 2025

Hi @Louise Woods 

The Lookup Work Items action returns a list of work items, and the Sprint field is also a list, leading to a nested list-of-lists.  When you want to use a function such as max on the endDate, the nested lists need to be flattened into a single list first:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#list.flatten--

For example:

{{lookupIssues.sprint.endDate.flatten.max}}

Another way to do this is with nested iteration, storing the result in a created variable as text, and then splitting again before using max.  That is needed for filtering cases, but not for your scenario.

 

Kind regards,
Bill

Louise Woods August 15, 2025

@Bill Sheboy thanks for your help. 

The problem is the Target Start and End is an advance road map field. 

When set the update work item action with this:

Screenshot 2025-08-15 115857.png

Get this error message:

Screenshot 2025-08-15 115947.png

We are writing it to the audit log to see:

Screenshot 2025-08-15 120418.pngScreenshot 2025-08-15 120129.png

Louise Woods August 20, 2025

@Bill Sheboy - Just wondering if you had any thoughts on the above before I change my plan of attach and use different date fields to get round the problem. 

Thanks, 

Lou 

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.
August 20, 2025

Hi @Louise Woods 

Please post the following for more context to help explain this symptom:

  • the current, complete rule in one image for continuity
  • an image of your entire Edit Work Item action
  • an image of the complete audit log for the rule execution, with all the areas expanded

Thanks!

Louise Woods August 21, 2025

Really appreciate your help @Bill Sheboy 

Full flow:

Full Flow v2.png

Edit Work Item:

Update Action Item.png

Audit Log:

Audit Log .png

Thanks!

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.
August 21, 2025

Thanks for that information, @Louise Woods 

Have you checked if there are multiple fields with that name, such that you have the incorrect custom field ID?  That may be done with an example work item and this how-to article:

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

The essential steps are:

  • in a new browser tab, get all the data for your work example work item with this URL, substituting in yourJiraURL and key:

yourJiraURL/rest/api/3/issue/DEV-4796?expand=names

  • search on the page for your field name, Target End, such as using CTRL-F
  • observe if there are multiple fields with that name in the work item

 

0 votes
Mikael Sandberg
Community Champion
August 14, 2025

Hi @Louise Woods,

In you automation do you have a lookup work item component? The smart value {{lookupIssues}} only works if you do a lookup work items first. 

Louise Woods August 14, 2025

Hi @Mikael Sandberg , 

Yes I do:

Screenshot 2025-08-14 145946.png

Mikael Sandberg
Community Champion
August 14, 2025

You have to merge the returned work items in order to get the date that is furtherest out. Have a look at this answer to a similar question. To do the merge you create a variable with the list of dates like this:

name: allEndDates

value: {{#lookupIssues}}{{#sprint}}{{endDate.jiraDate}},{{/}}{{/}

And then you can use this to get the max date:

{{allEndDates.substringBeforeLast(",").split(",").toDate.max}}

Suggest an answer

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

Atlassian Community Events