Add Worklog
This endpoint allows you to add a new worklog. One important thing you should notice that registered worklog author is “WorklogPRO App” itself. But our app will handle this situation and display author as the
Arguments:
[WorklogRequest] - Parameters for registering new worklog.
Returns:
[PagedIssues] - A page of issues including worklogs and some basic fields.
Example Mutation
mutation {
addWorklog(
worklogRequest: {
authorAccountId: "333555:43ab343-ffff-4d01-8c19-7965a544b3",
issueId: "10405",
timeSpent: "2h",
started: "2024-01-17T12:34:00.000+0000",
account: "aba329b9-acba-4b84-b06b-c207e2077241"
}
) {
worklog {
issueId,
id,
timeSpent
comment,
author {
accountId,
displayName
},
updateAuthor {
displayName
},
account {
id,
name
}
attributes {
id,
name,
value,
valueName
}
}
}
}Example Response
{
"data": {
"addWorklog": {
"worklog": {
"issueId": "10405",
"id": "98519",
"authorAccountId": "60454da9ceccdd006afa244d",
"timeSpent": "2h",
"comment": "",
"author": {
"accountId": "333555:43ab343-ffff-4d01-8c19-7965a544b3",
"displayName": "Deniz Oğuz"
},
"updateAuthor": {
"displayName": "WorklogPRO - Timesheets for Jira"
},
"account": "aba329b9-acba-4b84-b06b-c207e2077241",
"attributes": [
{ id: "a0ce7662-a100-4dc3-b6cd-327e68ad7e7a",
value: "heyo!"
},
{
id: "79189f3c-3cbc-4a27-87fa-ca0065456d4a",
value: "d2b66fd0-8f80-4b9c-9cf4-49ac134fc409"
},
{ id: "fac9dacd-3657-46a4-a379-e69f53c35a24",
value: "true"
}
]
}
}
}
}Types
WorklogRequest
Parameters for registering a new worklog.
input WorklogRequest {
issueId: String!
authorAccountId: String!
started: String!
timeSpent: String!
comment: String
adjustEstimate: AdjustEstimateOptions
newEstimate: String
reduceBy: String
account: String
attributes: [WorklogAttributeInput]
overrideEditableFlag: Boolean
notifyUsers: Boolean
}
WorklogAttributeInput
Key/Value pair for worklog attribute id and value.
input WorklogAttributeInput {
id: String!
value: String!
}The 'atlassian-addons-project-access' project role should be granted the 'WorklogPRO - Log work for others' permission in the project where worklogs need to be added.