Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I am trying to query ADO data using OData. My challenge is unable to query the "Description" field. The Below Error Appears
The query specified in the URI is not valid: VS403522: The property 'Description' is not available
The description is part our of work Items, yet unable to get that field in $metadata or normal work item query.
The Description (or any other longtext field) is not available via the standard oData feed. You can retrieve it via VSTS.Contents. I previously wrote a linkedin post on this after I worked it out myself.
You essentially make 2 calls. One to retrieve the workitem IDs (either via oData.Feed or Web.Contents) and another using that workitem ID to retieve the Description, etc.
So for instance using power query, you could use something similar to this (change OrgA and ProjA to your organisation and Project as well as other fields and other filter criteria):
let #"Retrieve oData" = Table.FromRecords({[ FeedData= OData.Feed("https://analytics.dev.azure.com/OrgA/_odata/v3.0-preview/WorkItems?" &"$filter=(Area/AreaPath eq 'ProjA\Sandbox' and Project/ProjectName eq 'ProjA' and WorkItemType eq 'Product Backlog Item')" &"&$select=WorkItemId,Title,State,WorkItemType,Priority") ]}), #"Expand Data" = Table.ExpandTableColumn(#"Retrieve oData", "FeedData", {"WorkItemId", "Title", "State","WorkItemType", "Priority"}, {"WorkItemId", "Title", "State","WorkItemType", "Priority"}), #"Retrieve VSTS Data" = Table.AddColumn(#"Expand Data","VSTS", each Json.Document(VSTS.Contents("https://dev.azure.com/OrgA/ProjA/_apis/wit/workitems/" &Number.ToText([WorkItemId])))), #"Expanded VSTS" = Table.ExpandRecordColumn(#"Retrieve VSTS Data", "VSTS", {"fields"}, {"VSTS.fields"}), #"Expanded VSTS.fields" = Table.ExpandRecordColumn(#"Expanded VSTS", "VSTS.fields", {"System.Description", "Microsoft.VSTS.Common.AcceptanceCriteria"}, {"VSTS.fields.System.Description", "VSTS.fields.Microsoft.VSTS.Common.AcceptanceCriteria"}) in #"Expanded VSTS.fields"
You should get something similar to this:
See also: https://www.linkedin.com/pulse/retrieve-long-text-fields-from-azure-devops-powerbi-van-der-vorst/
It also explains how to strip out the HTML, etc.
Thank you for your response.
So how do I get the Description field in my Odata query? This error comes only when i add the description field..
Here is my sample query
= OData.Feed("https://analytics.dev.azure.com/OrgName/ProjectName/_odata/v3.0-preview/WorkItems?" & "$filter=WorkItemType eq 'Risk'" & "&$select= WorkItemId, InProgressDate, CompletedDate, LeadTimeDays, CycleTimeDays, ProjectSK, WorkItemRevisionSK, AreaSK, Revision, Watermark, Title,Severity, Probability,WorkItemType, ChangedDate, CreatedDate, State, BusinessValue, ClosedDate, Priority, ResolvedDate, DueDate, Effort, OriginalEstimate,CompletedWork, RemainingWork, StartDate, StoryPoints, TargetDate, ParentWorkItemId, TagNames, StateCategory" & "&$expand=Description($select=WorkItemId)", null, [Implementation="2.0"])
Hi, @Sabarikumar7579 ;
Queries that violate an OData error rule will result in a failed response with a 400 (Bad Request) status code. Associate messages don't appear within the property. Instead, they'll generate an error message in the property in the JSON response.
OData Analytics query guidelines - Azure DevOps | Microsoft Learn
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
39 | |
21 | |
20 | |
19 | |
13 |
User | Count |
---|---|
67 | |
54 | |
42 | |
28 | |
22 |