I'm looking to create an automation that sums a custom field that is listed on subtasks to that custom field on their parent item. Lesson Count is a custom field (number) and the field would be edited for subtasks and rolled up to the Parent work item.
Any ideas what's missing here?
Thank you in advance!
Without seeing the details of the edit, I hypothesize it looks like this:
{{issue.subtasks.myCustomField.sum}}
That likely does not work because the subtasks smart value only contains some of the fields for each one. If it contained all of them, you could imagine a scenario where the subtasks link to other issues, which then link to others, pulling in more and more data...
The fix is to use a Lookup Work Items action to gather the subtasks and then sum the field from the results.
Kind regards,
Bill
Oops, thanks @Bill Sheboy and @Trudy Claspill - somehow I knew I could count on both of you to chime in quickly!
For the Edit work item fields step, I have setting Lesson Count: {{issue.customfield_10676.plus(issue.subtasks.customfield_10676)}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your access of the field in the subtasks is missing the sum, so first try setting the field to this
{{issue.subtasks.customfield_10676.sum}}
If that does not help, please try using the lookup instead as Trudy and I suggested:
{{lookupIssues.customfield_10676.sum}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Changing the field to
{{issue.subtasks.customfield_10676.sum}}
worked!
Thank you both!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Amanda Barber
The structure is correct.
What are the details of your Edit Work Item Fields action?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And what is the Type of the project (Company Managed or Team Managed)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Within the For Parent branch you could add as the first component a Lookup Issues action with JQL to gather the subtasks meeting your criteria
Then in the Edit action set the field in the parent issue using a smart value like this that references the custom field of the subtasks
{{lookupIssues.customfield_12345.sum}}
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.