To create a worklog via the Jira Tempo API, I would POST the following data:
{
"attributes": {
"_Activity_": {
"name": "Activity",
"workAttributeId": 1,
"value": "Research"
}
},
"billableSeconds": null,
"comment": null,
"remainingEstimate": null,
"originTaskId": "PROJECTX-2",
"timeSpentSeconds": 10944,
"worker": "janedoe",
"started": "2021-03-22",
"endDate": "2021-03-26T00:00:00.000"
}
Where do I get the value I'm supposed to send with the "worker" key? I've tried different variations of my name, including my email address and the workerId that is returned when I pull data for an existing worklog, but I still get the same response:
HTTP/2 400
{"errors":{"worker":"User is invalid"}}
Can you please confirm if you are using the Server/DC or Cloud version of Tempo?
Your question is marked as jira-software-cloud, but the payload in your screenshot is for the Tempo Timesheets REST API for the Server/DC version.
For information about the Tempo Cloud REST API to create worklogs, please take a look at this page.
On Cloud, the JIRA user account id needs to be used. This information is displayed, e.g., in the URL, when viewing a user in the JIRA user management.
Best regards,
Susanne Götz
Tempo team
To add (just a little) to what @Susanne Götz _Tempo_ says, from this end it looks like you are indeed on Jira Cloud, @Gene Dascher.
You may have inadvertently reviewed our Server/DC API docs, vs our Cloud API docs.
You may also wish to consider joining the Tempo slack workspace for developers (let me know if you're interested and I will send and invite).
Best,
-dave
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm using the Cloud version. Here is the exact payload that I'm sending to https://api.tempo.io/tempo-timesheets/4/worklogs:
{"billableSeconds":5400,
"timeSpentSeconds":5400,
"comment":"Development time spent on AA-1234",
"started":"2023-04-25",
"originTaskId":"AA-1234",
"worker":"[user id value]"}
The value I sent for "workerId" is the value I see at the end of the URL when I go to our Jira page in my browser, click on my user icon in the top right of the page, then choose "Profile", which takes me to the URL : "https://[our URL]/jira/people/[user id value]". I'm using the value at the END of that URL that I have noted as "[user id value]". I'm still getting that same "User is invalid" error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like we were typing at the same time, @Gene Dascher 🤪
You do have the right docs. at hand. I'm sure @Susanne Götz _Tempo_, or someone else will chime in based on the new details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for confirming that you are using the Cloud version.
Can you please change the REST API for this call to
POST https://api.tempo.io/4/worklogs
and the payload should be similar to
{
"issueId": "12345",
"timeSpentSeconds": 5400,
"billableSeconds": 5400,
"startDate": "2023-05-02",
"startTime": "10:06:00",
"description": "Creating a worklog via REST API",
"authorAccountId": "557058:cc8b3ba1-1268-446e-abcd1234",
"remainingEstimateSeconds": 18800
}
Please take a look at Tempo Cloud Worklog REST API for more information.
Best regards,
Susanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Susanne Götz _Tempo_ where do I get the value for "issueID"? I searched that entire document you sent the link to and the only place I see issueID is in the worklog section. I don't see how to retrieve the issueID via the API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The issueId is a value that is provided by JIRA, so there is no Tempo REST API to retrieve this information for an issue.
You can retrieve this information with a JIRA REST API by using the issue key
GET YOUR_JIRA/rest/api/3/issue/{issueIdOrKey}
(see https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get)
The issue key can also be seen when exporting the issue to XML (use the "..." in the upper right corner of the issue view and select "Export XML").
Best regards,
Susanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.