Document toolboxDocument toolbox

Summarize worked time by issues

The worklog query can be accessed from the link below:

http://myjira/rest/jira-worklog-query/REST-API-VERSION/find/worklogsByIssues

This function queries worklogs - filtered by the given parameters - and summarize the worked time by issues. The returned issues can be filtered by a JQL expression. The response are paginated, with default page size of 25 issues.

 

GET parameters of the worklogs query:

parametervalueoptionaldescription
startDate"YYYY-MM-DD"falseThe result will only contain worklogs after this date
endDate"YYYY-MM-DD"falseThe result will only contain worklogs before this date. The default value is the current date.
group/userstringfalseA JIRA group or user name whose worklogs are queried. One of them is required.
jqlstringtrueThe returned issues are filtered by this JQL expression. By default, all issues are returned.
fieldsstring listtrueThe list of fields to return for each issue. By default, no additional fields are returned.More info
startAtinttrueThe index of the first issue to return (0-based)
maxResultsinttrueThe maximum number of issues to return (default is 25).

Available response representations:

  • 200 - application/json Example response with no additional fields parameter:
{
  "startAt": 0,
  "maxResults": 25,
  "total": 2,
  "issues": [
    {
      "id": "13405",
      "self": "http://localhost:8080/rest/api/2/issue/13405",
      "key": "TEST-1",
      "timespent": 1440
    },
    {
      "id": "13406",
      "self": "http://localhost:8080/rest/api/2/issue/13406",
      "key": "TEST-2",
      "timespent": 35760
    }
  ]
}

Example response with "fields=summary,progress" parameter:

{
  "startAt": 0,
  "maxResults": 25,
  "total": 1,
  "issues": [
    {
      "id": "13411",
      "self": "http://localhost:8080/rest/api/2/issue/13411",
      "key": "NEW-1",
      "fields": {
        "progress": {
          "progress": 84000,
          "total": 84000,
          "percent": 100
        },
        "summary": "new issue1"
      },
      "timespent": 67080
    }
  ]
}
  • 400 - application/json Returned if there is a problem running the query. Example:
{
  "errorMessages": [
    "Cannot parse the 'startDate' parameter: 2013-0ghjg6-25"
  ],
  "errors": {
  }
}