I have a python 3 script that is adding worklog entries for specified issues. The script uses the requests module with POST and passes the appropriate payload. I am able to successfully add these worklogs but I want to specify the started date/time for some later reporting purposes.
When I add the "started:" key - the script fails with a 500 error. When I remove it, I get the desired 201.
The working payload is simply:
{ "comment": "This is a comment, "timeSpentSeconds": 3600 }
The failing payload is:
{ "comment": ''This is a comment", "started": "2024-10-30T00:00:00.000-0400", "timeSpentSeconds": 3600 }
The url in the requests.post is:
https://<url for our instance>/rest/api/2/issue/12345/worklog - where 12345 is the issue key
I tried various time values in the same format but all error out with the 500
I changed the key "started": to "created": and this DOES go through without errors, but I believe "created" is just being ignored. The worklog is still created with the time when the script ran.
If I review the worklogs via the api, the "started": is just the time the entries came in when the script runs.
I see examples online, where people are passing the "started" parameter, and they say it works.
Google AI suggested something like dateStarted - I don't recall, exactly but JIRA did not recognize that and I looked at all previous worklogs and there is no such key/parameter.
Any ideas?
[ FYI - I edited the offset in the sample payload. I had -4000. It should be -0400. It has been corrected in the post ]