The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
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)

TAGS
AUG Leaders

Atlassian Community Events