Worklogs

General information

Available since v. 1.8.*

Available since v. 1.37.* - Added dateOrder parameter

Available since v. 1.8.* - Available ONLY for Jira Administrators

Available since v. 1.65.* - Available to all users, but only Jira Administrators can get worklogs for all users, otherwise the user will see only his worklogs



Get worklogs for user

Method type - GET

URL:

  • {JIRA_URL}/rest/extender/1.0/worklog/user/{JIRA_USER}?dateFrom={DATE}&dateTo={DATE}

where {JIRA_USER} is JIRA user name, like admin

Example URL:

  • {JIRA_URL}/rest/extender/1.0/worklog/user/adminUser?dateFrom=2018-01-01&dateTo=2018-01-15

Response format - JSON

Example

{
    "total": 2,
    "maxResults": 1000,
    "startAt": 0,
    "worklogs": [
        {
            "issueId": 10000,
            "issueKey": "PROJ-1",
            "createdDate": 1521829042851,
            "lastUpdateDate": 1521829042851,
            "workLogDescription": "",
            "timeWorked": 60,
            "lastUpdateUser": "admin",
            "user": "admin",
            "startDate": 1521829042851,
            "workLogId": 10000
        },
        {
            "issueId": 10000,
            "issueKey": "PROJ-1",
            "createdDate": 1522516620000,
            "lastUpdateDate": 1522516620000,
            "workLogDescription": "",
            "timeWorked": 1860,
            "lastUpdateUser": "admin",
            "user": "admin",
            "startDate": 1522516620000,
            "workLogId": 10001
        }
    ]
}

Parameters

  • dateFrom - required - date in format yyyy-MM-dd
  • dateTo - required - date in format yyyy-MM-dd
  • dateOrder - optional - you can specific order for startDate parameter - available value (empty, desc, asc)
  • projectKey - optional - you can specific project key
  • formatDate - optional - available value (true or empty) - default worklog dates (createdDate, lastUpdatedDate, startDate) format is milliseconds, if you set this parameter to true, all dates format change into string yyyy-MM-dd HH:mm:ss.SSS 

     formatDate example


    ...
            {
                "issueId": 10000,
                "issueKey": "AAAAA-1",
                "createdDate": "2018-03-23 19:17:10.826",
                "lastUpdateDate": "2018-03-23 19:17:10.826",
                "workLogDescription": "",
                "timeWorked": 60,
                "lastUpdateUser": "admin",
                "user": "admin",
                "startDate": "2018-03-01 19:17:00.000",
                "workLogId": 10000
            }
    ...
  • startAt and maxResults - optional - please see Pagination section bottom of this page


Get worklogs for issue

Method type - GET

URL:

  • {JIRA_URL}/rest/extender/1.0/worklog/issue/{ISSUEID_OR_KEY}?dateFrom={DATE}&dateTo={DATE}

where {ISSUEID_OR_KEY} is JIRA issue key or id, like KEY-1 or 10001

Example URL:

  • {JIRA_URL}/rest/extender/1.0/worklog/issue/KEY-1?dateFrom=2018-01-01&dateTo=2018-01-15

Response format - JSON

{
    "total": 2,
    "maxResults": 1000,
    "startAt": 0,
    "worklogs": [
        {
            "issueId": 10000,
            "issueKey": "PROJ-1",
            "createdDate": 1521829042851,
            "lastUpdateDate": 1521829042851,
            "workLogDescription": "",
            "timeWorked": 60,
            "lastUpdateUser": "admin",
            "user": "admin",
            "startDate": 1521829042851,
            "workLogId": 10000
        },
        {
            "issueId": 10000,
            "issueKey": "PROJ-1",
            "createdDate": 1522516620000,
            "lastUpdateDate": 1522516620000,
            "workLogDescription": "",
            "timeWorked": 1860,
            "lastUpdateUser": "admin",
            "user": "admin",
            "startDate": 1522516620000,
            "workLogId": 10001
        }
    ]
}

Parameters

  • dateFrom - required - date in format yyyy-MM-dd
  • dateTo - required - date in format yyyy-MM-dd
  • dateOrder - optional - you can specific order for startDate parameter - available value (empty, desc, asc)
  • formatDate - optional - available value (true or empty) - default worklog dates (createdDate, lastUpdatedDate, startDate) format is milliseconds, if you set this parameter to true, all dates format change into string yyyy-MM-dd HH:mm:ss.SSS

     formatDate example


    ...
            {
                "issueId": 10000,
                "issueKey": "AAAAA-1",
                "createdDate": "2018-03-23 19:17:10.826",
                "lastUpdateDate": "2018-03-23 19:17:10.826",
                "workLogDescription": "",
                "timeWorked": 60,
                "lastUpdateUser": "admin",
                "user": "admin",
                "startDate": "2018-03-01 19:17:00.000",
                "workLogId": 10000
            }
    ...
  • startAt and maxResults - optional - please see Pagination section bottom of this page


Get worklogs for JQL query

Method type - GET

URL:

  • {JIRA_URL}/rest/extender/1.0/worklog/query?jql={JQL_QUERY}

where {JQL_QUERY} is JQL query

Example URL:

  • {JIRA_URL}/rest/extender/1.0/worklog/query?jql=issuekey%20%3D%20KEY-1

Response format - JSON

{
    "total": 2,
    "maxResults": 1000,
    "startAt": 0,
    "worklogs": [
        {
            "issueId": 10000,
            "issueKey": "KEY-1",
            "createdDate": 1521829042851,
            "lastUpdateDate": 1521829042851,
            "workLogDescription": "",
            "timeWorked": 60,
            "lastUpdateUser": "admin",
            "user": "admin",
            "startDate": 1521829042851,
            "workLogId": 10000
        },
        {
            "issueId": 10000,
            "issueKey": "KEY-1",
            "createdDate": 1522516620000,
            "lastUpdateDate": 1522516620000,
            "workLogDescription": "",
            "timeWorked": 1860,
            "lastUpdateUser": "admin",
            "user": "admin",
            "startDate": 1522516620000,
            "workLogId": 10001
        }
    ]
}

Parameters

  • jql - required - JQL query
  • dateOrder - optional - you can specific order for startDate parameter - available value (empty, desc, asc)
  • formatDate - optional - available value (true or empty) - default worklog dates (createdDate, lastUpdatedDate, startDate) format is milliseconds, if you set this parameter to true, all dates format change into string yyyy-MM-dd HH:mm:ss.SSS

     formatDate example


    ...
            {
                "issueId": 10000,
                "issueKey": "AAAAA-1",
                "createdDate": "2018-03-23 19:17:10.826",
                "lastUpdateDate": "2018-03-23 19:17:10.826",
                "workLogDescription": "",
                "timeWorked": 60,
                "lastUpdateUser": "admin",
                "user": "admin",
                "startDate": "2018-03-01 19:17:00.000",
                "workLogId": 10000
            }
    ...
  • startAt and maxResults - optional - please see Pagination section bottom of this page

How to build correct jql parameter value

Create JQL in standard JIRA place where you can search issue or create JQL’s for filters/gadgets (Issue (top-menu) -> Current Search or Search for Issues) and search issues. 

Now check URL link for this query

and copy selected jql parameter value




Pagination

This REST API uses pagination to improve performance for all Jira users. Pagination is enforced for methods that could return a large collection of items. When you make a request to a paged API, the response will wrap the returned array of values in a JSON object with paging metadata, for example:

{
    "startAt" : 0,
    "maxResults" : 10,
    "total": 200,
    "worklogs": [
        { /* result 0 */ },
        { /* result 1 */ },
        { /* result 2 */ }
    ]
}

Where:

  • startAt is the index of the first item returned in the page of results.
  • maxResults is the maximum number of items that can be returned per page. Each API endpoint may have a different limit for the number of items returned, and these limits may change without notice. (default value - 1000)
  • total is the total number of items contained in all pages. This number may change as the client requests the subsequent pages, therefore the client should always assume that the requested page can be empty.

Example:

  • {JIRA_URL}/rest/extender/1.0/worklog/user/adminUser?dateFrom=2018-01-01&dateTo=2018-01-15&startAt=10&maxResults=20
  • {JIRA_URL}/rest/extender/1.0/worklog/issue/KEY-1?dateFrom=2018-01-01&dateTo=2018-02-01&maxResults=1000