I'm trying to create a worklog via the Tempo 'worklogs' API, without success.
curl -D- -u myuser:mupassword -X POST -d @worklog.post -H "Content-Type: application/json" 'https://mydomain.atlassian.net/rest/tempo-timesheets/3/worklogs/'
This is my JSON in the 'worklog.post' file:
{ "issue":
{
"key":"MC-8948"
},
"comment":"This is a comment",
"dateStarted":"2017-11-17T00:00:00.000+1200",
"timeSpentSeconds":180
}
It fails with
{"errors":{"worker":"User is invalid","startDate":"Date is invalid"},"errorMessages":[],"reasons":["VALIDATION_FAILED"],"flushedErrorMessages":[]}
I don't believe it's an authentication problem because I can make a GET request without any problem.
I'm under the impression that this is the right documentation, but maybe I'm wrong.
It's all a bit of a mystery!
Thanks heaps.
Kerry
PS: adding ?tempoApiToken to the URL makes no difference
See answer above from Susanne Götz
Apparently I was using the wrong end point. Rather than:
https://mydomain.atlassian.net/rest/tempo-timesheets/3/worklogs/
I should've used:
https://api.tempo.io/2/worklogs
Note also that I had success with:
https://mydomain.atlassian.net/rest/api/2/issue/{task}/worklog
More documentation available at https://tempo-io.github.io/tempo-api-docs/#worklogs
Hi Rahul,
Can you please let us know if you are using the Server or the Cloud version. Each version has their own set of API's and require different authentications.
Regards,
Susanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good day Susanne,
Thank you for the quick response.
We use the JIRA DC, here are the details.
JIRA:
TEMPO:
The interesting thing is, it is happening for only one user. There are no complaints from any of the other ~2400 users.
System.Net.WebException: The remote server returned an unexpected response: (400) BadRequest.
{"errors":{"worker":"User is invalid"},"errorMessages":[],"reasons":["VALIDATION_FAILED"]}
Regards,
Rahul Savaikar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rahul,
Can you please create a ticket for this in our Tempo support so we can better follow up on this.
It might be useful to get some more information about the affected user ( f.x if his username was changed ) and the body you are sending with the request.
Regards,
Susanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It might be nice if they could throw some hints back here too, so the next person might be able to get the problem resolved. (I'm using Cloud version, btw)
That said, I worked around the problem by not using the Tempo API at all. I'm instead calling:
https://mydomain.atlassian.net/rest/api/2/issue/{task}/worklog
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To create a worklog on Cloud using the Tempo API, you will need to use:
POST https://api.tempo.io/2/worklogs
The authorization is done via Bearer Token ( you can find or generate your bearer token in Tempo, Settings, API Integration).
Please take also a look at https://tempo-io.github.io/tempo-api-docs/ for more information.
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_ - Can you please help here?
I too am facing a similar issue and haven't found any leads on it.
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.