Internal error when I try to add a worklog

Hi guys,

   I am facing some problems when I try to add a worklog.

the url is

https://<MYACCOUNT>.atlassian.net/rest/api/2/issue/<ISSUE_ID>/worklog

and the json is

{"comment":"MyTimeTracker Input","started":"2017-08-20T01:20:38.957-03:00","timeSpent":"20m"}

and always when I post this I receive Internal Server Error.

 

Could you please help me with this issue!?

Tks in advance!

1 answer

0 vote

Hi Carlos,

I found this code to work:

'{"timeSpent":"20m","comment":"MyTimeTracker Input","started":"2017-08-20T01:20:38.957-0300"}'

I think there's a couple things going on here:

  1. If you only change the time it does not work and you get a 500 error.
  2. If you put timeSpent at the beginning it works.
  3. If you change the time back to -03:00 you get a 500 error.

From the testing there are two issues here:

  1. timeSpent needs to be first
  2. You're running into the bug reported in JRASERVER-31460 where the JIRA REST API throws a 500 error code instead of a400 error code with a proper message when an invalid expand value is passed to search the JQL endpoint.

Please vote on JRASERVER-31460 to add impact and test with timeSpent in the beginning to see if you get different results.

Cheers,

Branden

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Schuster
Posted Mar 28, 2018 in Jira Software

Can a company’s culture make or break agile adoption?

Can a new-to-agile team survive and thrive in a non-agile culture? If so, what advice would you give to those trying to be agile in a non-agile culture? What's the key(s) to success? Share your thoug...

13,139 views 15 13
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you