Hello,
I’ve created a custom field at the subtask level and would like to calculate its sum at the story level, limited to subtasks with a status of “Done.” I can sum all subtasks successfully, but I haven’t found a method to filter them based on status.
Thanks in advance!
BR
Greetings, community!
As a reminder, when posting bot / AI-generated content the source needs to be referenced in the text of your post and the content validated. To learn more, please see the community guidelines:
https://community.atlassian.com/forums/custom/page/page-id/rules-of-engagement
The "smells" the suggestions are bot / AI-generated are:
Kind regards,
Bill
Hi @Saif Allah AZZAZA
This version should work for you.
Trigger: Issue transitioned → To Done
Condition: Issue type = Sub-task
Branch: For parent
Action: Re-fetch issue data
Action: Lookup issues with JQL:
parent = {{issue.key}} and issuetype = sub-task and status = done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would manage this with two rules.
First rule:
Trigger: Issue transitioned --> To Done
Branch: Parent
Actions:
Re-fetch issue data
Edit issue fields --> Story/task field = {{issue.subtasks. filter(s => s.status.name =="Done").sum(customfield_12345)}}
Rule 2 (optional, when subtask leaves Done):
Trigger: Issue transitioned --> From Done
Branch: Parent
Actions:
Re-fetch issue data
Edit issue fields --> same expression as above
(Enable Allow rule trigger: issues in this rule can trigger other rules,” so the Story or taks updates correctly)
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.