It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

API issue: POST worklog does not work

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

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

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

0 votes

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
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

245 views 1 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you