Filter by Custom Field Issue

Officially Answered

Comments

4 comments

  • Avatar
    Vanja Pletikosić

    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

     

    0
    Comment actions Permalink
  • Avatar
    Collin Maxon

    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)

    0
    Comment actions Permalink
  • Avatar
    Collin Maxon

    Update: I have actually removed the "Custom." from my field definition and it is now working!  Don't know why since that seems to be contrary to the documentation, but I'll take it.  Thanks!

    0
    Comment actions Permalink
  • Avatar
    Vanja Pletikosić

    Hello Collin,

    Thank you for the update. And apologies, the article was unclear because we were using Custom as part of the field name. We have altered the article to make it more clear.
    Happy to hear that you were able to sort it out by yourself.

    Best regards,
    Vanja

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk