Reference

Endpoint Query Work Item Comments


Name

query_workitem_comments

Description

Get work item comments associated with the specified project and organization that are filtered by a Wiql query. (A team can optionally be specified as well.). Read more about this API here https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/wiql/query-by-wiql?view=azure-devops-rest-7.0 and here https://learn.microsoft.com/en-us/azure/devops/boards/queries/query-operators-variables?view=azure-devops [API reference]

Related Tables

WorkItemComments

Parameters

Parameter Required Options
Name: Project

Label: Project Name

The Name of the project.
YES
Name: Query

Label: Wiql Query

The WIQL query (refer Azure DevOps Help to learn Wiql syntax.
YES
Name: Team

Label: Team Id or Name

Id or name of the team associated with the query.
Name: TimePrecision

Label: Use time precision

Whether or not to use time precision.
Option Value
false false
true true

Output Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
Id DT_I4 int
WorkItemId DT_I4 int
Text DT_NTEXT nvarchar(MAX)
RenderedText DT_NTEXT nvarchar(MAX)
Format DT_WSTR nvarchar(4000) 4000
CreatedDate DT_DBTIMESTAMP datetime
CreatedByUniqueName DT_WSTR nvarchar(4000) 4000
CreatedById DT_WSTR nvarchar(4000) 4000
CreatedByDisplayName DT_WSTR nvarchar(4000) 4000
ModifiedDate DT_DBTIMESTAMP datetime
ModifiedByUniqueName DT_WSTR nvarchar(4000) 4000
ModifiedById DT_WSTR nvarchar(4000) 4000
ModifiedByDisplayName DT_WSTR nvarchar(4000) 4000
Url DT_WSTR nvarchar(1000) 1000
If the column you are looking for is missing, consider customizing Azure DevOps Connector.

Input Columns

Label Data Type (SSIS) Data Type (SQL) Length Description
There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime.

Examples

SSIS

Use Azure DevOps Connector in API Source or in API Destination SSIS Data Flow components to read or write data.

API Source

This Endpoint belongs to the WorkItemComments table, therefore it is better to use it, instead of accessing the endpoint directly:

API Source - Azure DevOps
Azure DevOps Connector can be used to integrate Azure DevOps data in your App / BI Tools. You can create, read, query, modify, and delete WorkItems, Projects, Teams and more.
Azure DevOps
WorkItemComments
Required Parameters
Project Name Fill-in the parameter...
Wiql Query Fill-in the parameter...
Optional Parameters
Team Id or Name
Use time precision
SSIS API Source - Read from table or endpoint

API Destination

This Endpoint belongs to the WorkItemComments table, therefore it is better to use it, instead of accessing the endpoint directly. Use this table and table-operation pair to query work item comments:

API Destination - Azure DevOps
Azure DevOps Connector can be used to integrate Azure DevOps data in your App / BI Tools. You can create, read, query, modify, and delete WorkItems, Projects, Teams and more.
Azure DevOps
WorkItemComments
Select
Required Parameters
Project Name Fill-in the parameter...
Wiql Query Fill-in the parameter...
Optional Parameters
Team Id or Name
Use time precision
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Get all comments for all work items

SELECT * FROM WorkItemComments

Query work item comments using Wiql

SELECT 
	  Id
	, WorkItemId
	, Text
	, RenderedText
	, Format
	, CreatedDate
	, CreatedByUniqueName
	, CreatedById
	, CreatedByDisplayName
	, ModifiedDate
	, ModifiedByUniqueName
	, ModifiedById
	, ModifiedByDisplayName
	, Url
FROM WorkItemComments 
--WHERE Id=5283490 -- get just one comment for specific WorkItem Id
WITH(Query='SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject]=''ProductTesting'' and [System.Id]=6455 ORDER BY [System.Id] DESC')

query_workitem_comments endpoint belongs to WorkItemComments table(s), and can therefore be used via those table(s).

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Get all comments for all work items

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM WorkItemComments';

EXEC (@MyQuery) AT [LS_TO_AZURE_DEVOPS_IN_GATEWAY];

Query work item comments using Wiql

DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT 
	  Id
	, WorkItemId
	, Text
	, RenderedText
	, Format
	, CreatedDate
	, CreatedByUniqueName
	, CreatedById
	, CreatedByDisplayName
	, ModifiedDate
	, ModifiedByUniqueName
	, ModifiedById
	, ModifiedByDisplayName
	, Url
FROM WorkItemComments 
--WHERE Id=5283490 -- get just one comment for specific WorkItem Id
WITH(Query=''SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject]=''''ProductTesting'''' and [System.Id]=6455 ORDER BY [System.Id] DESC'')';

EXEC (@MyQuery) AT [LS_TO_AZURE_DEVOPS_IN_GATEWAY];

query_workitem_comments endpoint belongs to WorkItemComments table(s), and can therefore be used via those table(s).