When I want to add worklogs to an issue in Jira with the REST api I get an errormessage. "Field 'worklog' cannot be set. It is not on the appropriate screen, or unknown."
I have been looking at the json below for qit some time but I don't see what is wrong, my time zone is "Europe/Berlin", so +1000 sould be correct. The issue exists.
{
"update":{
"worklog":[
{
"add":{
"author":"apiuser",
"comment":"Prepare",
"created":"2017-10-26T16:11:21.000+0100",
"issueId":"10300",
"started":"2017-10-20T00:00:00.000+0100",
"timeSpentSeconds":900,
"updateAuthor":"apiuser",
"updated":"2017-10-26T16:11:21.000+0100"
}
}
]
}
}
The response I get is below.
{"errorMessages":[],"errors":{"worklog":"Field 'worklog' cannot be set. It is not on the appropriate screen, or unknown."}}
Anyone a sugestion?
Hey Ed,
If I'm not mistaken, you use this endpoint:
If so, you must edit the Edit Issue screen of the issue and add the Log Work field to it.
Also take note that, timeSpentSeconds doesn't work, so you should use something like this for 900 seconds:
Other than that, please consider using this endpoint instead:
I hope this helps.
Cheers,
Andy
With post it is working now, thanks for that.
The users Author and UpdateAuthor are not set to the users I gave in the json, they are set to the name of the user that is used for the API call, is there a way around this so I can add WorkLogs with the actual user that entered a worklog in an other system. I want to synchonise two issue systems, an old one that is used by many people that don't know Jira and we don't want to force them to learn to use Jira, but for developers we want to use Jira because there we can force for example force the flow od statuses.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BTW, I used "timeSpentSeconds":900 and that is working fine in Jira 7.11, it is converted to 15m
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Ed,
BTW, I used "timeSpentSeconds":900 and that is working fine in Jira 7.11, it is converted to 15m
You're right. timeSpentSeconds works for the POST. What I meant to say was, it doesn't work for the PUT.
is there a way around this so I can add WorkLogs with the actual user that entered a worklog in an other system
No, neither with POST nor PUT. There's a feature request for that here:
How about using that user's credentials for the REST call?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.