I've got a curl script that can add a worklog via the Jira API:
curl -u <MyUserName>:<MyAPIToken> -H "Content-Type: application/json" -X POST "<OurJiraInstanceUrl>/rest/api/2/issue/<IssueId>/worklog" -d "{\"comment\":\"Test\",\"started\":\"2020-02-19T09:00:00.000-0700\",\"timeSpent\":\"8h\"}
However, using v3 of the API with everything else exactly the same always results in:
{"errorMessages":["Invalid document format","Worklog must not be null."],"errors":{}}
Not sure what's so different, especially considering the documentation here and here appear to be the same...
Would somebody mind clarifying and/or updating the documentation for v3?
From v2 to v3, the format of 'comment ' changed from a simple string to the more complex Atlassian Document Format (as documented in the API spec).
but the docs say "A comment about the worklog in Atlassian Document Format. Optional when creating or updating a worklog."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't understand the reply from @Niko Tzioras. @Tomas Eychaner did you find out what the problem is?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, you saved my day! This must be a bug in the API...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.