Search code examples
c#.netazure-devopswiql

WIQL The query references a field that does not exist. The error is caused by «[Microsoft.VSTS.Common.Priorty]».'


below is my Query and i am getting the Error:
query references a field that does not exist. The error is caused by «[Microsoft.VSTS.Common.Priorty]».'

string querystring = string.Format("select [System.Id], [System.WorkItemType]," +
                " [System.Title],[System.State],[System.AssignedTo]," +
                "[Microsoft.VSTS.Scheduling.StoryPoints]," +
                "[Microsoft.VSTS.Common.Priority],[System.IterationPath]" +
                " FROM WorkItemLinks" +
                " WHERE" +
                " ([Source].[System.TeamProject]='{0}'" +
                " and [Source].[System.IterationPath]='MRI_SCRUM_GIT\\Pluse Pheonix\\Sprint 1'" +
                " and (Source.[System.WorkitemType]='User Story' " +
                " or [Source].[System.WorkitemType]='Task'))" +
                " and [System.Links.LinkType]='System.LinkTypes.Hierarchy-Forward'" +
                " and [Target].[System.WorkItemType] <> '' " +
                " ORDER BY [Microsoft.VSTS.Common.StackRank]," +
                " [Microsoft.VSTS.Common.Priorty]" +
                " mode (Recursive)", projectname);



          Query treequery = new Query(workItemStore, querystring);
          WorkItemLinkInfo[] links = treequery.RunLinkQuery();

Solution

  • Replace [Microsoft.VSTS.Common.Priorty] to [Microsoft.VSTS.Common.Priority] in ORDER By statement.