Hi,
I want to get the completion percentage of subtasks for all the parent issues, I just need the percentage to be displayed for all the parent issues rather than me going in and manually checking for each and every parent issue. Is there a way? By custom field or export to excel or PDF or a dashboard gadget or by using automation rules or Rest API's.
Please explain me if there is a way to achieve this.
Thanks
Unfortunately this isn't built into JIRA (out of the box) in a way to use as you have asked. It is probably only worth solving if you have a lot of sub-tasks.
You listed a couple of options that would work: export to Excel, or automation rules. In addition, if you have one of the marketplace JQL scripting add-ons, you can use that instead.
For Excel, you would build a spreadsheet to correlate the parent/child relationships, and roll up the data by status or status category. Then regularly export the data and paste it into your spreadsheet to process it.
For automation rules, you would maintain your own counts. It will be busy and noisy in alerts, but it could work.
If you need this periodically, and not up to date every minute, I would use the Excel approach.
Best regards,
Bill
Hi Bill_Sheboy,
Thanks for your reply.
I think excel will work, can you please explain me how to get the subtask percentage number of all the parent issues in a spread sheet?
Regards,
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sam,
Here is an outline of an Excel approach. Please adjust based on what you want. For example, what do you mean by "% complete"?
It may end up looking like the below image
Best regards,
Bill
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 @David Woo
I cannot tell if you are using Jira Cloud or Server/Data Center...so let's assume Cloud for now:
First, I would use a Lookup Issues action to gather all of the subtasks for the parent using JQL: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues
Then, using smart value, list filtering on the desired status value (or other fields), prune down to the desired results to produce a list that can be counted. https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
Another alternative is to use Lookup Issues repeatedly with your specific criteria ( e.g. "Epic Link" = {{triggerIssue.Epic Link}} AND status = "In Progress" ) and store each result in a Created Variable to use later. https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-variable
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill, I am using the CLOUD version. I have the Rule in place, but what I have noticed is that the value seems to capture from when the last rule ran, which is odd. I created three fields to capture Task Done, total Task and Percentage Completed.
So, when an issue is set to DONE, the rule is trigger.
It verifies the issueType is a sub-task
Then it branch into its parent (screenshot attached)
I have it set the three fields to EMPTY (This is where I see the first problem since the next step is to create a comment with those field and they don't go to Empty.
I then un a lookup issue search which returns me the number of issues that are Done and update the V Total Issues Done field
I do the same with getting the total issues count and update the V Total Issues Count field.
And last, I calculate both fields*100 for the Percentage Completed Fields:
{{issue.v Total Issues Done.divide(issue.v Total Issues Count)}}*100
And last, I output all fields into the comments to compare value and for some odd reason, the numbers don't match even thought they are the exact field names used.
Thoughts?
The output looks wonky, since the RAW value is correct in the top half, but the comments and percentage completion has been getting its value from the previous run of the RULE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After creating 2 variables (one for Done, the other for Count). it got me closer, the numbers match up now which is great. But for some odd reason, it is complaining about :
Could not convert the field value to a number. Please ensure the value is a number, math expression or smart-value that can be converted into a number.
I tried TotalIssuesDone.value with no success to see if a numeric value is produced. Thoughts?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Bill S.
Your additional information helped me to figure this out. By leveraging the asNumber call, I now get the percent completed value:
{{#=}}{{TotalIssuesDone.asNumber}}/{{TotalIssuesCount.asNumber}}*100{{/}}
I got it now. I am now going to see about converting this back into a string so I can put a % symbol after it. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You may use the function asPercentage to do that:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/#asPercentage
Please note...
Also I noticed that you were clearing fields in a rule with edit, and then editing again. Rules always start an edit from the data values at load time when the rule triggered. If you want the updated values used, try including a Re-fetch action.
For example from a made up scenario:
My understanding is Re-fetch only applies to the issue(s) from the trigger, and not any branches.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think our app Dynamic Custom Fields for Jira would be perfect for your use case.
The app allows you to create custom fields that have their values automatically calculated based on a Jira expression you provide.
I have quickly thought of an expression that would display the percentage of all completed subtasks.
let subtaskTotal = issue.subtasks.length;
let subtaskDone = issue.subtasks.map(s => s.status.category.key).filter(k => k == "done").length;
subtaskTotal > 0 ? subtaskDone / subtaskTotal * 100 + "%": ""
You could also just display it as a number custom field without the "%" if you want to use the field value for further calculations.
Let me know if this would work for you :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
I have Jira Data Center instance where LookUp issue won't work,
Can you please help me how can i achieve this in Jira Data center version for calculating % completion of child issue?
Regards,
Reshma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lookup Issues is currently in progress for adding to Server/ Data Center, and you can watch progress here: https://jira.atlassian.com/browse/JIRAAUTOSERVER-53
Until then, would you please confirm what you are trying to measure; that is, what do you mean by % completion for a child issue?
Server / Data Center work-arounds for similar scenarios often use the scheduled trigger with bulk-handling option enabled to substitute for Lookup Issues. Please look here to learn more about that: https://confluence.atlassian.com/automation/run-a-rule-against-issues-in-bulk-993924653.html
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
I basically want epic to show the % completion of the story point which are moved to "done" state.
I have automation rule to sum up all the story points which are moved to "done" state and add to epic, but i am unable to figure out how to get % of story point which are move to "done" state.
Regards,
Reshma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What do you mean by "show the % completion"?
For example if you wanted to send a message/email, you could use the bulk-handling feature of branches and smart value, list filtering, and math functions to calculate the sum of story points for done issues divided by the total.
If instead you want to update a field in the epic (for later reporting usage), your options are limited by the rule trigger you use. One slower work-around is to call the REST API with a JQL search, as this will emulate the behavior of Lookup Issues for gathering the issues for the math operation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Suppose I have 2 story in an epic each having story points in it.
Story 1: 50 story points
Story 2 :50 story points
Story 1 is completed and moved to "done" State. Now epic should have field "℅completion" Which should say 50℅.
Can you please help me with how can I achieve this scenario?Is there and math formula which can be used for this?
Regards,
Reshma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are at least a couple of approaches, as I noted earlier...
(1) You noted that you already have a rule to sum up the story points for issues in the epic moved to done. Let's assume you are storing that in a field in the epic. You could duplicate that rule so it includes all the issues, not just the completed ones. And then use the math operations, as described here: https://confluence.atlassian.com/automation/jira-smart-values-math-expressions-993924866.html
For example, if your epic fields were named TotalStoryPoints and TotalCompletedStoryPoints a math expression could be:
{{issue.TotalCompletedStoryPoints.divide(issue.TotalStoryPoints).multiply(100)}}
And then use the other math operations to adjust the precision display, as needed.
(2) Or...you could call the REST API to perform an issue search with JQL. This will return all the issues in epic in a web response, with the fields you want to use. Then use math operations and smart value, list filtering to select the completed versus total story points.
Here are some references to help trying that method:
https://confluence.atlassian.com/automation/jira-automation-actions-993924834.html
https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Thanks for your suggestion.
I am able to get % done value with the math formula shared.
It shows as 8.100.
Is there any formula to shows as 81%?
Regards,
Reshma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What are the two values used which led to 8.100 for your "done story points" and "total story points"? Those may indicate where there is a problem.
And, you may also use the ROUND function to get the precision that you want, and add the percent sign to the end as text. Please look here for more information about that function: https://confluence.atlassian.com/automation/jira-smart-values-math-expressions-993924866.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Bill,
I tried using below math expression to get percentage value.
{{issue.Story Points.asPercentage}}
But it gave error stating "Could not convert filed value to number, math expression "
Story Points : 8.000%
Regards,
Reshma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Smart values are name, spacing, and case-sensitive, so please try this to see if that is the cause of the error:
{{issue.Story points.asPercentage}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Thank You for your help.
Unfortunately the functionality is not working as expected. now..
I have created three new fields. Story Points in Epic, Story Points Left in Epic, Percentage Completion.
Story Pints in Epic will sum up all the story points when issue is transitioned form To to In Development State.
Story Points Left in Epic will sum up all the story points when issue is transitioned from all Development to Done state.
Percentage Completion will , add Story Points in Epic and Story Points Left in Epic which will be dived by 100 and give percentage.
Now the issue is when the Stories are created and assigned story points, when one story is transitioned from To to In Progress, then it also sum up the story pints which are not transitioned.
Can you please help me if my above workflow has any issue ?
Regards,
Reshma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please post images of:
Those will provide context to help understand the symptoms you are observing. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
Please find screenshot of the rule which is not working.
Math expression :
{{webhookResponse.body.issues.fields.customfield_XXXX.sum}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When that web request, response comes back, I believe it is text and not typed, such as a numbers.
The work-around is to force this into a number using a math expression containing an iterator over the issues, perhaps like this:
{{#=}}0{{#webhookResponse.body.issues}}+{{customfield_XXXX}}{{/}}{{/}}
If that does not work, I recommend writing the response from that web request action to the audit log to confirm the structure matches what you expect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Bill,
Many thanks for your support.
I tried using above math expression but it gave me 0 in the log.
Actually we used JMW where To Do state is traversed to Done state.
When i tried getting logs of issue,status when issue is moved to Done from In development state it gave me To Do in the log.
When we move to done state, we give resolution as Done. I tried to get resolution name using {{resolution.name}} still nothing seems working. Is there way to get resolution status?
Reagrds,
Reshma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try writing {{webhookResponse.body}} to the audit log to confirm the structure matches what you expect.
If that works, then do the same with {{webhookResponse.body.issues.first}}
And, what is the type of the custom field you are trying to sum?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
I tried using above expression, it gave first story in Jira which is marked as done.
I want to sum up only story which are moved to done state.
I am using number field custom filed to sum up story points value.
Regards,
Reshma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, and now let's go further to confirm your custom field contains what you expect by writing these to the audit log. Remember to update that with your specific custom field's id value.
The field is: {{webhookResponse.body.issues.first.customfield_12345}}
The field as a number is: {{webhookResponse.body.issues.first.customfield_12345.asNumber}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bil,,
Hope your doing well.
I have added above syntax in LOg work and i see that story whihc atre in To DO as well getting calculated whne story is move dto Done state.
I am basiclaly uisnh below webhhok url in Sedn web request .
{{baseUrl}}/rest/agile/1.0/epic/{{issue.key}}/issue?maxResult=100
Wnated to know if there is api clal that can be made here to get all the iissues in epic whihc are in done state?
Regards,
Reshma Ulvekar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try using the Log action, not the Log Work action. The "Log action" will write a value to the rule's audit log, and that can be viewed after the rule runs.
You also asked: is there a way to get all issues in an epic in a done state?
One way to do that is with the issue search function with the REST API using JQL, such as with:
"Epic Link" = yourEpicKey AND statusCategory = Done
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
I have tried using Log action and i see that Story point filed which are in To Do state is considered as well when issue is transition to Done state.
Can this be becuase of the way the wekbook url gets the response and edit the filed the which is having same custom filed in al the status?
Webhook URL : {{baseUrl}}/rest/agile/1.0/epic/{{issue.key}}/issue?maxResult=100
Edit issue : {{webhookResponse.body.issues.fields.customfield_xxxx.sum}}
Also can you please help me how can we pass jql in the webhhokk url? I am unable to figure out the same.
Regards,
Reshma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you have at least 2 options:
Use that same REST API function which gets all issues in the epic, and then use smart value, list filtering and math functions to add up the story points. Please look here to learn about those ways: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588 and https://confluence.atlassian.com/automation/jira-smart-values-math-expressions-993924866.html
Or instead use the issue search REST API function, as that would allow using the JQL. https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples/#searching-for-issues-examples
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.