Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I get an error "Field 'worklog' cannot be set. It is not on the appropriate screen, or unknown."

Ed Schrauwers August 16, 2018

When I want to add worklogs to an issue in Jira with the REST api I get an errormessage. "Field 'worklog' cannot be set. It is not on the appropriate screen, or unknown."

 

I have been looking at the json below for qit some time but I don't see what is wrong, my time zone is "Europe/Berlin", so +1000 sould be correct. The issue exists.

{
  "update":{
    "worklog":[
      {
        "add":{
          "author":"apiuser",
          "comment":"Prepare",
          "created":"2017-10-26T16:11:21.000+0100",
          "issueId":"10300",
          "started":"2017-10-20T00:00:00.000+0100",
          "timeSpentSeconds":900,
          "updateAuthor":"apiuser",
          "updated":"2017-10-26T16:11:21.000+0100"
        }
      }
    ]
  }
}

The response I get is below.

{"errorMessages":[],"errors":{"worklog":"Field 'worklog' cannot be set. It is not on the appropriate screen, or unknown."}}

Anyone a sugestion?

1 answer

1 accepted

0 votes
Answer accepted
Andy Nguyen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2018

Hey Ed,

If I'm not mistaken, you use this endpoint:

If so, you must edit the Edit Issue screen of the issue and add the Log Work field to it.

Also take note that, timeSpentSeconds doesn't work, so you should use something like this for 900 seconds:

  • "timeSpent":"15m"

Other than that, please consider using this endpoint instead:

I hope this helps.

Cheers,

Andy

Ed Schrauwers August 16, 2018

With post it is working now, thanks for that.

The users Author and UpdateAuthor are not set to the users I gave in the json, they are set to the name of the user that is used for the API call, is there a way around this so I can add WorkLogs with the actual user that entered a worklog in an other system. I want to synchonise two issue systems, an old one that is used by many people that don't know Jira and we don't want to force them to learn to use Jira, but for developers we want to use Jira because there we can force for example force the flow od statuses.

Ed Schrauwers August 16, 2018

BTW, I used "timeSpentSeconds":900 and that is working fine in Jira 7.11, it is converted to 15m

Andy Nguyen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2018

Hey Ed,

BTW, I used "timeSpentSeconds":900 and that is working fine in Jira 7.11, it is converted to 15m

You're right. timeSpentSeconds works for the POST. What I meant to say was, it doesn't work for the PUT.

is there a way around this so I can add WorkLogs with the actual user that entered a worklog in an other system

No, neither with POST nor PUT. There's a feature request for that here:

How about using that user's credentials for the REST call?

Ed Schrauwers August 21, 2018

Using the users credentials will be the only solution, thanks.

Suggest an answer

Log in or Sign up to answer