`Timestamp` not selectable in `workItemsHierarchyAllLevels` and `orderby` not working without `worklogsFilter`

Officially Answered

Comments

4 comments

  • Avatar
    dev

    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

    0
    Comment actions Permalink
  • Avatar
    Mohamed Barbouch

    Hi Anton,

     

    Thanks for your reply. 

    1. Is there an alternative to select a field that represents a given Timestamp range in the "worklogsFilter"?
    2. 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
    0
    Comment actions Permalink
  • Avatar
    dev
    1. 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.
    2. 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

    0
    Comment actions Permalink
  • Avatar
    Mohamed Barbouch

    Dear Anton,

     

    Thanks for the explanation. The provided query is used in an offline setting and usually the timestamp range is within 6 months. The provided example was just to demonstrate the issue with orderby param.

     

    Kinds regards,

    Mohamed

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk