Table Worklogs
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_worklogs | |
| INSERT | create_worklog | |
| UPDATE | update_worklog | |
| UPSERT | ||
| DELETE | delete_worklogs | |
| LOOKUP | get_worklogs |
Examples
SSIS
Use Jira Connector in API Source component to read data or in API Destination component to read/write data:
Read from Worklogs table using API Source
| Optional Parameters | |
|---|---|
| Fields | id,key |
| Issue Key(s) or Ids - Comma Separated (CBS-10,PRA-13) | |
Read/write to Worklogs table using API Destination
| Optional Parameters | |
|---|---|
| Fields | id,key |
| Issue Key(s) or Ids - Comma Separated (CBS-10,PRA-13) | |
ODBC application
Use these SQL queries in your ODBC application data source:
Read worklog entries for an issue by ID or Key
<p>Gets all worklog (time) entries 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 Worklogs Where IssueId=10003 --WITH(Key='10003')
Read worklogs for issues by JQL
<p>Gets all worklogs for issues that match a JQL expression. The connector finds issues with the given JQL, then returns time entries for those issues. Use the same JQL syntax as in the “Read issues using JQL query” example.</p>
SELECT * FROM Worklogs WITH (Jql='status IN (Done, Closed) AND created > -5d' )
Read worklogs
<p>Gets all worklog (time) entries from every issue. Use this when you need a single list of all time entries. To limit by issue or date, use the examples that filter by issue ID/Key, by JQL, or by modified-after date.</p>
SELECT * FROM Worklogs
Create a worklog
<p>Creates a single worklog on an issue. Supply <code>TimeSpentInSeconds</code>, <code>Comment</code>, and <code>StartedAt</code>, and identify the issue with <code>IssueIdOrKey</code> in <code>WITH</code>. Use <code>OUTPUT=1</code> to return the created worklog.</p>
INSERT INTO Worklogs(TimeSpentInSeconds, Comment, StartedAt)
VALUES(7200,'My Comment!','2020-02-23T16:20:30.123+0000')
WITH (IssueIdOrKey='ISSKEY-1', OUTPUT=1)
Update a worklog
<p>Updates an existing worklog. Set <code>TimeSpentInSeconds</code>, <code>Comment</code>, and/or <code>StartedAt</code>, and identify the issue and worklog with <code>IssueIdOrKey</code> and <code>WorklogId</code> in <code>WITH</code>.</p>
UPDATE Worklogs
SET TimeSpentInSeconds = 28800
,Comment='My Comment!'
,StartedAt='2020-01-23T16:20:30.123+0000'
WITH (IssueIdOrKey='MTK-1', WorklogId='123465', OUTPUT=1, ContinueOn404Error=0)
Delete a worklog
<p>Deletes a single worklog. Identify the issue and worklog with <code>IssueIdOrKey</code> and <code>WorklogId</code> in the <code>WITH</code> clause.</p>
DELETE FROM Worklogs
WITH (IssueIdOrKey='10020', WorklogId='123465', OUTPUT=1, ContinueOn404Error=0)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Read worklog entries for an issue by ID or Key
<p>Gets all worklog (time) entries 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 Worklogs Where IssueId=10003 --WITH(Key=''10003'')';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Read worklogs for issues by JQL
<p>Gets all worklogs for issues that match a JQL expression. The connector finds issues with the given JQL, then returns time entries for those issues. Use the same JQL syntax as in the “Read issues using JQL query” example.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Worklogs WITH (Jql=''status IN (Done, Closed) AND created > -5d'' )';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Read worklogs
<p>Gets all worklog (time) entries from every issue. Use this when you need a single list of all time entries. To limit by issue or date, use the examples that filter by issue ID/Key, by JQL, or by modified-after date.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Worklogs';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Create a worklog
<p>Creates a single worklog on an issue. Supply <code>TimeSpentInSeconds</code>, <code>Comment</code>, and <code>StartedAt</code>, and identify the issue with <code>IssueIdOrKey</code> in <code>WITH</code>. Use <code>OUTPUT=1</code> to return the created worklog.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO Worklogs(TimeSpentInSeconds, Comment, StartedAt)
VALUES(7200,''My Comment!'',''2020-02-23T16:20:30.123+0000'')
WITH (IssueIdOrKey=''ISSKEY-1'', OUTPUT=1)';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Update a worklog
<p>Updates an existing worklog. Set <code>TimeSpentInSeconds</code>, <code>Comment</code>, and/or <code>StartedAt</code>, and identify the issue and worklog with <code>IssueIdOrKey</code> and <code>WorklogId</code> in <code>WITH</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'UPDATE Worklogs
SET TimeSpentInSeconds = 28800
,Comment=''My Comment!''
,StartedAt=''2020-01-23T16:20:30.123+0000''
WITH (IssueIdOrKey=''MTK-1'', WorklogId=''123465'', OUTPUT=1, ContinueOn404Error=0)';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];
Delete a worklog
<p>Deletes a single worklog. Identify the issue and worklog with <code>IssueIdOrKey</code> and <code>WorklogId</code> in the <code>WITH</code> clause.</p>
DECLARE @MyQuery NVARCHAR(MAX) = 'DELETE FROM Worklogs
WITH (IssueIdOrKey=''10020'', WorklogId=''123465'', OUTPUT=1, ContinueOn404Error=0)';
EXEC (@MyQuery) AT [LS_TO_JIRA_IN_GATEWAY];