Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

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

$
0
0

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: http://www.visualstudio.com/en-us/integrate/reference/reference-vso-work-item-wiql-vsi

I've taken the sample request: https://fabrikam.visualstudio.com/DefaultCollection/Fabrikam-Fiber-Git/_apis/wit/wiql?api-version=1.0-preview.2 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}.visualstudio.com/defaultcollection/[{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,

Morné



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>