Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Jira API Add Worklog v2 and v3 have different requirements Edited

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?

3 answers

Thank you, you saved my day! This must be a bug in the API...

I don't understand the reply from @Niko Tzioras@Tomas Eychaner did you find out what the problem is? 

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).

Suggest an answer

Log in or Sign up to answer
TAGS

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