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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.