Visual Studio Integrate REST Api - WIQL request returns status 400 (Bad Request) RRS feed

  • Question

  • Hi,

    I'm attempting to submit a WIQL (Work Item Query Language) request to the Visual Studio Online REST api but receiving a status code 400 (Bad Request).

    I'm using the sample request of the first example "Run a query" of the reference documentation listed here:

    I've taken the sample request: and substituted "fabrikam" with our account and "Fabrikam-Fiber-Git" with our team project name.

    I've used the exact same query listed for the sample request:

      "query": "Select [System.WorkItemType],[System.Title],[System.State],[Microsoft.VSTS.Scheduling.Effort],[System.IterationPath] FROM WorkItemLinks WHERE Source.[System.WorkItemType] IN GROUP 'Microsoft.RequirementCategory' AND Target.[System.WorkItemType] IN GROUP 'Microsoft.RequirementCategory' AND Target.[System.State] IN ('New','Approved','Committed') AND [System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward' ORDER BY [Microsoft.VSTS.Common.BacklogPriority] ASC,[System.Id] ASC MODE (Recursive, ReturnMatchingChildren)"

    Couple of things that I've tried:

    1. I've tried both "api-version=1.0-preview.2" and "api-version=1.0-preview.1"

    2. I've left out the project name from the request url: Based on the query format listed in the example "https://{account}[{project}/]_apis/wit/wiql?api-version={version}" I'm assuming that the wrapping of the project section in the url in square brackets ([{project}/]) indicates that this section is optional.

    3. I've tried a simpler query:

     "query": "Select [System.WorkItemType],[System.Title],[System.State],[Microsoft.VSTS.Scheduling.Effort],[System.IterationPath], [Microsoft.VSTS.Common.BacklogPriority] From WorkItems"

    Any help would be greatly appreciated.

    Kind Regards,


    • Edited by MornéM Thursday, October 9, 2014 10:40 AM Formatting changes
    • Moved by Caillen Monday, October 13, 2014 9:24 AM
    Thursday, October 9, 2014 10:38 AM


All replies

  • Hello Morne,

    Visual Studio Integrate forum is for questions about Visual Studio extension development. Yours seems to be about Visual Studio Online REST API to query something. Maybe Visual Studio Online forum is better, I'm not sure.

    I move it to [where is this forum for ...] forum, where the moderator will direct you to the right forum.

    Thanks for your understanding.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 13, 2014 9:24 AM
  • Don't know where this was moved from. This page;

    Check out our top integration questions

    indicates you could ask here.

    Visual Studio Integrate forum on MSDN




    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Saturday, October 18, 2014 5:03 PM