I am new to Azure DevOps Extensions. Not sure what I am doing wrong here but I cannot get certain fields for work items returned by the getWorkItems
REST API.
I have tried everything I can find on the message boards and still cannot get certain specified fields to return in the results.
You can see the fields array below to see the specific fields I am trying to get back with the results.
Here are the fields that I can't seem to get returned in the results
"Microsoft.VSTS.Scheduling.StartDate"
"Microsoft.VSTS.Scheduling.StoryPoints"
"Microsoft.VSTS.Scheduling.TargetDate"
"System.AssignedTo"
"Microsoft.VSTS.Scheduling.CompletedWork"
VSS.require(["VSS/Service", "TFS/WorkItemTracking/RestClient"],
function (VSS_Service, TFS_Wit_WebApi) {
// Get the REST client
var witClient = VSS_Service.getCollectionClient(TFS_Wit_WebApi.WorkItemTrackingHttpClient);
var fields = ["System.Id", "Microsoft.VSTS.Scheduling.StartDate", "Microsoft.VSTS.Scheduling.StoryPoints", "Microsoft.VSTS.Scheduling.TargetDate", "System.WorkItemType", "System.Title", "System.AssignedTo", "System.State", "System.Tags", "Microsoft.VSTS.Scheduling.CompletedWork", "System.Description", "Microsoft.VSTS.Scheduling.FinishDate"];
var ids = [workItemID];
witClient.getWorkItems(ids, fields).then(
function(result) {
document.getElementById("codeblock").innerText = JSON.stringify(result);
});
});
Here is the JSON that is returned
[{
"id": 7743,
"rev": 3,
"fields": {
"System.Id": 1234,
"System.WorkItemType": "Feature",
"System.State": "Closed",
"System.Title": "Sprint 39 - Technical"
},
"url": "https://<companyurl>/_apis/wit/workItems/1234"
}]
I have even tried the ExpandAll optional parameter in the getWorkItems
call and those fields are not returned with the results.
i.e:
witClient.getWorkItems(ids, undefined, undefined, ["All"]).then(
function(result) {
I am stumped, any help or direction on where to look to find these values would be very helpful and appreciated.