Getting Issues with Worklogs
This endpoint allows you to retrieve issues and their worklogs using the following parameters. This endpoint is paginated, you need to use startAt
value at each iteration to retrieve all issues matching the parameters.
Arguments:
startDate
- Start date in ISO date format. REQUIREDendDate
- End date in ISO date format. Required. REQUIREDprojectKeys
- Key of projects to include in the report. Optional.issueKeys
- Key of issues to include in the report. Optional.userAccountIds
- Account Id of users to include in the report. Optional.startAt
- The index of the first item to return in the page of results (page offset). The base index and the default value is 0.maxResults
- Maximum number of issues to return. Max and default value is 100. Even if you pass a higher value than 100, only 100 issues are returned. If you have more than 100 issues, you need to use pagination parameters and request the next page of issues/worklogs using startAt parameter.
Returns:
[PagedIssues] - A page of issues including worklogs and some basic fields.
Example Query
query {
getIssuesWithWorklogs(parameters: {startDate: "2024-01-01", endDate: "2024-01-02", startAt: 0, projectKeys: ["TRA"]}) {
issues {
id,
key,
customFields {
"customfield_10221": null,
"customfield_10101": {
"hasEpicLinkFieldDependency": false,
"showField": false,
"nonEditableReason": {
"reason": "PLUGIN_LICENSE_ERROR",
"message": "The Parent Link is only available to Jira Premium users."
}
},
},
fields {
summary,
project {
id,
key,
name
}
worklog {
worklogs {
id,
started,
timeSpent,
author {
accountId,
displayName
}
comment
attributes {
id,
name,
value,
valueName
}
account {
id,
name
}
}
}
}
},
startAt,
total
}
}
Example Response
{
"data": {
"getIssuesWithWorklogs": {
"issues": [
{
"id": "47829",
"key": "TRA-51557",
"fields": {
"summary": "perf:Brute Tota Assueverit Parturient Equidem Graeco Interesset Agam Dolores vis",
"project": {
"id": "10104",
"key": "TRA",
"name": "Troubled Art"
},
"worklog": {
"worklogs": [
{
"id": "88505",
"started": "2024-01-01T00:00:00.000+0300",
"timeSpent": "1h",
"author": {
"accountId": "5ef05c2549ee4d0abc187183",
"displayName": "Starware Support"
},
"comment": "perf: This is text work description",
"attributes": [
{
"id": "23834c2e-aaf8-42c2-b6f3-44dbe48627fc",
"name": "Billable",
"value": "false",
"valueName": null
},
{
"id": "088a9386-4efe-41a2-a2d9-3d26238d90ac",
"name": "Type of Work",
"value": "f349d3dd-9b8e-4c28-8dbd-66faa374e644",
"valueName": "Disabled Attribute Value for Testing"
},
{
"id": "17152ab9-5e8f-4905-bfba-33bc2ad58fdc",
"name": "Invoice Number",
"value": "99077",
"valueName": null
},
{
"id": "784bb77c-51d1-4e0c-bdf5-0b20b8ccf2cf",
"name": "Billable Time",
"value": "3600",
"valueName": null
}
],
"account": null
}
]
}
}
},
{
"id": "47767",
"key": "TRA-51551",
"fields": {
"summary": "perf:Rhoncus Explicari Pertinacia Elementum Autem Ridiculus Luctus Malesuada Verear Donec",
"project": {
"id": "10104",
"key": "TRA",
"name": "Troubled Art"
},
"worklog": {
"worklogs": [
{
"id": "88484",
"started": "2024-01-01T00:00:00.000+0300",
"timeSpent": "30m",
"author": {
"accountId": "5ef05c2549ee4d0abc187183",
"displayName": "Starware Support"
},
"comment": "perf:",
"attributes": [
{
"id": "23834c2e-aaf8-42c2-b6f3-44dbe48627fc",
"name": "Billable",
"value": "false",
"valueName": null
},
{
"id": "088a9386-4efe-41a2-a2d9-3d26238d90ac",
"name": "Type of Work",
"value": "0265e977-1554-45c5-b0d8-e591831e9a49",
"valueName": "Requirement Analysis"
},
{
"id": "17152ab9-5e8f-4905-bfba-33bc2ad58fdc",
"name": "Invoice Number",
"value": "34478",
"valueName": null
},
{
"id": "784bb77c-51d1-4e0c-bdf5-0b20b8ccf2cf",
"name": "Billable Time",
"value": "3600",
"valueName": null
}
],
"account": null
}
]
}
}
}
],
"startAt": 0,
"total": 168
}
}
}
Types
PagedIssues
A page of issues including worklogs and some other issue fields.
As you can see from the schema definition. There is no fixed type for custom fields. Data returned by a custom fields has no specific format.
type PagedIssues {
startAt: Int!
maxResults: Int!
total: Int!
issues: [Issue!]!
}
type Issue {
id: String!
key: String!
self: String!
fields: IssueFields!,
customFields: JSON
}
type IssueFields {
summary: String!
issuetype: IssueType!
assignee: User
reporter: User
worklog: PagedWorklogs
components: [ProjectComponent!]
fixVersions: [Version!]
affectsVersions: [Version!]
status: Status!
project: Project!
priority: Priority!
parent: Parent
}
type PagedWorklogs {
startAt: Int!
maxResults: Int!
total: Int!
worklogs: [Worklog!]!
}
type Worklog {
self: String
id: String!
issueId: String!
started: DateTime!
created: DateTime!
updated: DateTime!
timeSpent: String!
timeSpentSeconds: Int!
author: User!
updateAuthor: User!
comment: String
account: WorklogAccount
attributes: [WorklogAttribute!]
}
type WorklogAccount {
id: String!
name: String!
}
type WorklogAttribute {
id: String!
name: String!
value: String!
valueName: String
}