Message: "Error converting value "SELECT [System.Id] FROM WorkItems " to type 'Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.Wiql'. Path '', line 1, position 36. ↵"
.queryByWiql
<!DOCTYPE html> <html> <head> <script src="sdk/scripts/VSS.SDK.min.js"></script> <script type="text/javascript"> VSS.init({ explicitNotifyLoaded: true, usePlatformStyles: true }); VSS.require(["TFS/Dashboards/WidgetHelpers", "TFS/WorkItemTracking/RestClient"], function (WidgetHelpers, TFS_Wit_WebApi) { WidgetHelpers.IncludeWidgetStyles(); VSS.register("dashboarddemo2", function () { debugger; var context = VSS.getWebContext() var projectId = context.project.id; var teamId = context.team.id; var GetWorkItems = function (widgetSettings) { debugger; // Get a WIT client to make REST calls to VSTS var queryr = "SELECT [System.Id] FROM WorkItems "; debugger; return TFS_Wit_WebApi.getClient().queryByWiql(queryr).then(function (query) { var ty="ddd"; debugger; // Create a list with query details var $list = $('<ul>'); $list.append($('<li>').text("Query ID: " + query.id)); var $container = $('#query-info-container'); $container.empty(); $container.append($list); return true; }, function (error) { // Use the widget helper and return failure as Widget Status return false; }).catch(err => { debugger; console.log(err) }) // TypeError: faile } return { load: function (widgetSettings) { // Set your title var $title = $('h2.title'); $title.text('Hello World'); // debugger; var t2 = GetWorkItems(widgetSettings); return t2; } } }); VSS.notifyLoadSucceeded(); }); </script> </head> <body> <div class="widget"> <h2 class="title"></h2> <div id="query-info-container2"></div> </div> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)