`Timestamp` not selectable in `workItemsHierarchyAllLevels` and `orderby` not working without `worklogsFilter`
Officially AnsweredHi all,
I'm using the `workItemsHierarchyAllLevels` and want to select the `Timestamp` in order to verify the returned result with the date range set in the `worklogsFilter`. However, when I do that, I get the following error: "Status code: 500. Timestamp does not exist in your organization".
In addition, the `orderby` parameter works only if the `worklogsFilter` is set, otherwise I get the error "This set of parameters is not allowed. To learn how to avoid this, click the following link: https://www.7pace.com/redir/proper-odata-usage"
Thanks, Mohamed
-
Hi Mohamed,
Thank you for your message!
"Timestamp" cannot be selected because this property is not present in the model for this endpoint.
worklogsFilter is optional, but workItemsFilter is not. And orderby should work well without worklogsFilter.
Could you please provide more details that we could use to double check and possibly reproduce the issue?
Best regards,
Anton
-
Hi Anton,
Thanks for your reply.
- Is there an alternative to select a field that represents a given Timestamp range in the "worklogsFilter"?
- Yes, I was aware of that, that's why I was wondering.
In my case, the following request URL works:
/api/odata/v3.1/workItemsHierarchyAllLevels?$select=System_Id,System_Title,System_WorkItemType,System_TeamProject,TrackedItself,TrackedTotal&$filter=System_WorkItemType eq 'Feature'&workItemsFilter=System_WorkItemType ne ''&$orderby=TrackedTotal desc&worklogsFilter=Timestamp ge 0001-01-01T00:00:00Z and Timestamp lt 9999-12-31T00:00:00Z
and the following one is not:
/api/odata/v3.1/workItemsHierarchyAllLevels?$select=System_Id,System_Title,System_WorkItemType,System_TeamProject,TrackedItself,TrackedTotal&$filter=System_WorkItemType eq 'Feature'&workItemsFilter=System_WorkItemType ne ''&$orderby=TrackedTotal desc
-
- There is no alternative to Timestamp. The reason is the way workItemsHierarchyAllLevels works. It doesn't operate on a separate worklogs level, but summarizes worklogs times for each work item and its children. This is why you cannot see exact worklogs using this endpoint; you get only work items and sum of their worklogs times. But it is possible to use worklogsFilter to prefilter the worklogs of the given work items. That's why worklogsFilter supports Timestamp.
- We've rechecked the behaviour. worklogsFilter is not required until you use order on TrackedTotal property. You could find an explanation on the following article: https://support.7pace.com/hc/en-us/articles/360053455951
According to the provided queries, we see that you are trying to work around the set restrictions. These restrictions are in the API for a good reason - to avoid performance issues.
Therefore, we cannot promise that such queries will work stable; you can also hit the rate limits fairly easily this way (see https://support.7pace.com/hc/en-us/articles/360050677831#API%20Rate%20Limits).We recommend updating your queries so as the restrictions are used.
Best regards,
Anton
Please sign in to leave a comment.
Comments
4 comments