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.
Any advise or steps - please explain to me like I don't work in IT :-)
Thanks,
Lou
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.