Hi everybody!
Could somebody give the cue how to add a new entry of worklog in JIRA’s issue via REST API?
I try to add worklog entry via REST API line:
curl --request POST -u user:password -H “Content-Type: application/json” “http://jiraserver:port/rest/api/2/issue/TESTERR-2/worklog?author=user&started=20180221&timeSpentSeconds=3600&adjustEstimate=new&newEstimate=2d”
Or in case I’ve already added a one worklog manually and would like to add a new one via REST API:
curl --request POST -u user:password -H “Content-Type: application/json” “http://jiraserver:port/rest/api/2/issue/TESTERR-2/worklog?author=user&started=20180221&timeSpentSeconds=3600”
TESTERR-2 - this is a JIRA issue key.
It doesn’t matter what parameter I added the text of error always the same:
{“errorMessages”:[“No content to map to Object due to end of input”]}
I used this on Linux:
curl -u username:password -H “Content-Type: application/json” -X POST “http://jiraserver:port/rest/api/2/issue/TESTERR-2/worklog” -d ‘{“comment”:“I did some work here.”,“started”:“2018-02-21T00:00:00.000+0000”,“timeSpentSeconds”:12000}’
And I used these options format in cURL on Windows:
curl -u user:password -H “Content-Type: application/json” -X POST “http://jiraserver:port/rest/api/2/issue/TESTERR-2/worklog” -d “{\“comment\”:\“I did some work here.\”,\“started\”:\“2018-02-21T00:00:00.000+0000\”,\“timeSpentSeconds\”:12000}”
Hi, Neil!
I made some investigations about this question and JIRA REST API in general and I expanded my theme in another question which closely related to this.