At my company, we have added a work item type that sits above an Epic in Azure DevOps, let's say it's called "CompanyProject". I would like to have a widget that can show all of the CompanyProject work item types with the total number of hours for each child work item type that falls beneath it in the hierarchy. I have tried using workItemsHierarchyAllLevel with a workItemFilter to the "CompanyProject" type, but that loses all of the totalTracked hours for the items beneath it and totalTracked just shows up as 0.
Ideally I would rather just have a flat table view for this data as I don't need to drill-down to view items beneath the "CompanyProject" work item type.
How can I accomplish this?
-
Hello Bruce,
Thank you for reaching out to us. Instead of using the workItemsFilter to filter for the CompanyProject type, could you please try using just $filter and let me know if you are getting the desired results. Using $filter should only filter out the results and not the data, whereas using the workItemsFilter will filter the data as well.
Best regards,
Vanja -
Actually, I have to use workItemsHierarchyAllLevels to get all of the records, which is requiring a workItemsFilter. I was finally able to get it working, using just a flat table for the widget. I don't quite understand why the workItemsHierarchy endpoint doesn't give the desired results, but at least I got it working.
-
Hi Bruce,
The workItemsHierarchy endpoint returns only the root items as explained here, so maybe this is why you were not getting the desired results.
For the workItemsHierarchyAllLevels endpoint workItemsFilter requirement, you could use a kind of hack filter in case you wish to bypass it. You can just set the filter to filter out any work items where the work item type is empty, as such:&workItemsFilter=System_WorkItemType ne ''
I hope this helps, but I am glad to hear that you were able to get your widget working.
Best regards,
Vanja -
Hello Liz,
We haven't shared anything with Bruce other than my reply above. Please submit a ticket by emailing support@7pace.com so that we can assist you.
Best regards,
Vanja -
Hi. I was able to accomplish what I needed with the following widget:
{"type":"FlatTable","id":"","query":"$select=System_Id,System_WorkItemType,System_Title,TrackedTotal,CustomStringField1,CustomStringField2&customFields=Custom.ServiceNowID,Custom.Cap&workItemsFilter=System_WorkItemType ne ''&$filter=System_WorkItemType eq 'Project' and TrackedTotal gt 0&$orderby=TrackedTotal desc","endpoint":"workItemsHierarchyAllLevels","title":"Hours By Project","w":5,"h":3,"columns":[{"field":"System_Id","title":"ID","formatter":"WorkItemId","width":60},{"field":"System_Title","title":"Project","width":350},{"field":"CustomStringField1","title":"SNOW ID","width":100},{"field":"CustomStringField2","title":"CapEx","width":100},{"field":"TrackedTotal","title":"Hours","width":100,"formatter":"TimeLength"}],"autoSubtitle":false,"timeframeFilter":null,"y":0,"x":3,"odataVersion":"v3.1"}
We have a custom work item type called "Project" (not to be confused with a native project in ADO). You can see that I am also returning some custom fields. This example demonstrates how to roll up work to a particular work item level.
Please sign in to leave a comment.
Comments
6 comments