Table Comments
Description
No description available
Supported Operations
Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.| Method | Supported | Reference EndPoint |
|---|---|---|
| SELECT | get_comments | |
| INSERT | create_comment | |
| UPDATE | update_comment | |
| UPSERT | ||
| DELETE | delete_comment | |
| LOOKUP | get_comments |
Examples
SSIS
Use Jira Connector in API Source component to read data or in API Destination component to read/write data:
Read from Comments table using API Source
| Optional Parameters | |
|---|---|
| Fields | id,key |
| Issue Key(s) or Ids - Comma Separated (PRJA-10,PRJA-13) | |
Read/write to Comments table using API Destination
| Optional Parameters | |
|---|---|
| Fields | id,key |
| Issue Key(s) or Ids - Comma Separated (PRJA-10,PRJA-13) | |
ODBC application
Use these SQL queries in your ODBC application data source:
Read comments for all issues
<p>Gets every comment across all issues. Use this when you need a flat list of all comments. To limit by issue, use the following examples that filter by issue ID or Key, or by JQL.</p>
SELECT * FROM Comments
Read comments for an issue by ID or Key
<p>Gets all comments for one issue. Identify the issue by <code>IssueId</code> in the <code>WHERE</code> clause or by <code>Key</code> in <code>WITH</code>.</p>
SELECT * FROM Comments Where IssueId=10003 --OR WITH(Key='10003')
Read comments for an issue by Key
<p>Gets all comments for a single issue identified by its key (e.g. CS-1).</p>
SELECT * FROM Comments WITH(Key='CS-1')
Read comments for issues by JQL
<p>Gets all comments for issues that match a JQL expression. The connector first finds issues with the given JQL, then returns comments for those issues. Use the same JQL syntax as in the “Read issues using JQL query” example.</p>
SELECT * FROM Comments WITH (Jql='status IN (Done, Closed) AND created > -5d' )
Create a comment (plain text body)
<p>Creates a new plain-text comment on an issue. Supply the issue key or ID in <code>IssueId</code> and the comment text in <code>Body</code>. You can use functions such as <code><<FUN_NOW>></code> in the body.</p>
INSERT INTO Comments(IssueId,Body) VALUES('CS-2', 'Commented at <<FUN_NOW>>')
Create a comment (formatted body)
<p>Creates a new comment with formatted (ADF) content. Supply the issue key or ID and a JSON body that follows the Atlassian Document Format; the example shows a simple paragraph with text. Use <code>BodyFormatted</code> for the JSON string.</p>
INSERT INTO Comments(IssueId,BodyFormatted) VALUES('CS-3', '{ "content": [
{ "content": [
{ "text": "This is a valid ADF formatted comment.",
"type": "text" }
],
"type": "paragraph"
}
],
"type": "doc",
"version": 1
}
}')
Update an existing comment (plain text body)
<p>Updates an existing comment’s body. Identify the comment by <code>Id</code> in the <code>WHERE</code> clause and the issue by <code>IssueIdOrKey</code> in <code>WITH</code>. Set <code>Body</code> to the new plain text.</p>
UPDATE Comments
SET Body='Updated at <<FUN_NOW>>'
WHERE Id=10004
WITH(IssueIdOrKey='CS-2')
Delete an existing comment
<p>Deletes one comment. Identify the comment by <code>Id</code> in the <code>WHERE</code> clause and the issue by <code>IssueIdOrKey</code> in <code>WITH</code>.</p>
DELETE FROM Comments WHERE Id=10004 WITH(IssueIdOrKey='CS-2')
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Read comments for all issues
<p>Gets every comment across all issues. Use this when you need a flat list of all comments. To limit by issue, use the following examples that filter by issue ID or Key, or by JQL.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Comments';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Read comments for an issue by ID or Key
<p>Gets all comments for one issue. Identify the issue by <code>IssueId</code> in the <code>WHERE</code> clause or by <code>Key</code> in <code>WITH</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Comments Where IssueId=10003 --OR WITH(Key=''10003'')';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Read comments for an issue by Key
<p>Gets all comments for a single issue identified by its key (e.g. CS-1).</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Comments WITH(Key=''CS-1'')';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Read comments for issues by JQL
<p>Gets all comments for issues that match a JQL expression. The connector first finds issues with the given JQL, then returns comments for those issues. Use the same JQL syntax as in the “Read issues using JQL query” example.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Comments WITH (Jql=''status IN (Done, Closed) AND created > -5d'' )';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Create a comment (plain text body)
<p>Creates a new plain-text comment on an issue. Supply the issue key or ID in <code>IssueId</code> and the comment text in <code>Body</code>. You can use functions such as <code><<FUN_NOW>></code> in the body.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Comments(IssueId,Body) VALUES(''CS-2'', ''Commented at <<FUN_NOW>>'')';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Create a comment (formatted body)
<p>Creates a new comment with formatted (ADF) content. Supply the issue key or ID and a JSON body that follows the Atlassian Document Format; the example shows a simple paragraph with text. Use <code>BodyFormatted</code> for the JSON string.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Comments(IssueId,BodyFormatted) VALUES(''CS-3'', ''{ "content": [
{ "content": [
{ "text": "This is a valid ADF formatted comment.",
"type": "text" }
],
"type": "paragraph"
}
],
"type": "doc",
"version": 1
}
}'')';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Update an existing comment (plain text body)
<p>Updates an existing comment’s body. Identify the comment by <code>Id</code> in the <code>WHERE</code> clause and the issue by <code>IssueIdOrKey</code> in <code>WITH</code>. Set <code>Body</code> to the new plain text.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Comments
SET Body=''Updated at <<FUN_NOW>>''
WHERE Id=10004
WITH(IssueIdOrKey=''CS-2'')';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Delete an existing comment
<p>Deletes one comment. Identify the comment by <code>Id</code> in the <code>WHERE</code> clause and the issue by <code>IssueIdOrKey</code> in <code>WITH</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Comments WHERE Id=10004 WITH(IssueIdOrKey=''CS-2'')';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];