API issue: POST worklog does not work

Damien Knox September 22, 2019

Hello, I need to add a worklog entry by the API.
I do this according to the documentation:
https://docs.atlassian.com/software/jira/docs/api/REST/1000.1584.0/#api/2/issue/\{issueIdOrKey}/worklog-addWorklog

POST http://domain.atlassian.net/rest/api/2/issue/KEY-103/worklog
{
"comment": "I did some work here.",
"visibility": {
"type": "group",
"value": "jira-developers"
},
"started": "2017-12-07T09:23:19.552+0000",
"timeSpentSeconds": 12000
}

However, it works as GET: returns 200 (instead of 201) and a full list of existing worklogs as a result. No new records added.

2 answers

1 accepted

0 votes
Answer accepted
Damien Knox September 23, 2019

Insomnia REST client:2019-09-24_10h46_14.png

Python script:2019-09-24 10_48_53-timesheetcreate [C__Vesta_timesheetcreate] - ..._main.py [timesheetcreate] - PyC.png

Damien Knox September 23, 2019

I guess I figured it out, I used HTTP instead of HTTPS

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 23, 2019

It looks to me like whatever you are using to connect is issuing a GET instead of the required POST.  I'd start with a look at that call (I can't tell what it is just from "POST" stucj on the front)

Suggest an answer

Log in or Sign up to answer