Hello,
I do not have much experience with OData and so I'm confident that is a large portion of my problem; However, none of the documentation or forums have gotten me to the desired result.
My organization has a custom field in DevOps called MyOrg.Adhocwork.
I am attempting to create a basic Table Widget in the "Team Overview Report (Data Period)" that can filter the work items by MyOrg.Adhocwork eq 'true'.
{"type":"FlatTable","id":"","query":"
$filter=TrackedItself gt 0&$orderby=TrackedItself desc&$top=10
","odataVersion":"v3.0","endpoint":"workItems","title":
Okay, so this the default query. It already filters my data by filters set at the top of the page. And that is great! Now all I need to add the filter for my Adhocwork eq 'true'.
The various methods I have tried I get the following errors:
- "Can not resolve the segment identifier 'MyOrg.Adhocwork' in query option."
- " The specified type member 'CustomField1' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported."
Can someone set me straight on how to make this work?
One attempt at my query...
$select=CustomStringField1,System_Id,System_Title,System_WorkItemType,System_TeamProject&$filter=CustomStringField1 eq 'true' &$orderby=TrackedItself desc&customFields=MyOrg.Adhocwork
Thanks
-
Hello Collin,
Thank you for reaching out to us. We actually have an example of this exact functionality in our Widgets Gallery that you can check out HERE.
However, in your specific case, your filter is correct, however the definition of the custom fields is not. The format should be as such: &customFields=Custom.[field name]
So in your case it should be &customFields=Custom.MyOrg.Adhocwork in case that this is the correct custom field name that you see under Field Reference Name in the DevOps field. This article explains more about using custom fields.We also have a video that specifically covers the use of custom fields which may be useful for you to watch here: 7pace Timetracker Reporting: Custom Fields.
Let me know if this helps.
Kind regards,
Vanja -
Hi Vanja, thanks for your reply. Those articles & video are what I had been using to guide me previously but I had missed a few things.
The "Custom.[my field]" is a key one. I also realized that my field is boolean and that I needed to call out the Custom field differently for that. However I am getting a strange error to me. Or perhaps a whole page of errors.
Here is my query:
$select=CustomBooleanField1,TrackedItself,System_Id,System_Title,System_WorkItemType, System_TeamProject&$filter=CustomBooleanField1 eq 'true' and TrackedItself gt 0 &$orderby=TrackedItself desc &customFields=Custom.MyOrg.Adhocwork
I suspect it may have something to do with my filter statement perhaps? I have tried slight differences in my custom field, setting the API to 3.1 and 3.0, and changing my OData Endpoint between workItems and workItemsHierarchy.
Here is the error I am seeing.
(Image Removed)
Please sign in to leave a comment.
Comments
4 comments