Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×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
@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:
Get this error message:
We are writing it to the audit log to see:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please post the following for more context to help explain this symptom:
Thanks!
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.
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.