How do I log work for a user via the Jira Cloud REST API?

I'm trying to use the REST api in a laravel app, to add worklogs to an issue on my company's Jira Cloud instance.

Whenever I sent the request it gives me an error, "Can not instantiate value of type [simple type, class] from JSON String; no single-String constructor/factory method"

I'm sending the post request to with this JSON:

                "comment":"Testing pushing worklog using REST API",

I've also tried sending just:

"comment":"Testing pushing worklog using REST API",

Can anyone spot what I'm doing wrong?

1 answer

0 votes

Hi Benjamin,

Here is the example from the Cloud API documentation for updating a worklog:

    "comment": "I did some work here.",
    "visibility": {
        "type": "group",
        "value": "jira-developers"
    "started": "2017-08-15T06:53:06.605+0000",
    "timeSpentSeconds": 12000

The format you would use for the call is

Try that format and see if you get different results.



Thanks for your answer, but how would I give the worklog ID if I'm trying to create a worklog that doesn't exist yet, not update an existing one?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

950 views 3 9
Read article

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