Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

When add worklog via REST API(version 2), get 400 if the worklog contains 'adjustEstimate'

When trying to add worklog like below, get 400 as return code. However if I comments out the two lines with underscore(adjustEstimate and newEstimate), then will get 201 and the worklog can be added successfully.
        auth = self.USER + ':' + self.PASSWORD
        auth = bytes.decode(base64.b64encode(auth.encode('utf-8')))
        headers = {
            'Accept': 'application/json',
            'Content-Type': 'application/json',
            'Authorization': 'Basic {}'.format(auth),
       worklog = json.dumps({
            'comment':'add worklog for trial of auto log jira effort'
        res = requests.request(
            data = worklog,

1 answer

0 votes

Hey, you can try returning the response to that 400 error to get a better understanding of what the error message says. That will help you to know what's really wrong.

What is the "returning the response to that 400 error " ?


Do the above in your code on a new line to see what the response is all about.

Great thanks @Prince Nyeche, below are the error msg, seems the adjustEstimate is not supported

{'errorMessages': ['Unrecognized field "adjustEstimate" (Class, not marked as ignorable\n at [Source: org.apache.catalina.connector.CoyoteInputStream@cfc7291; line: 1, column: 41] (through reference chain:["adjustEstimate"])']}

@Prince Nyeche  Do you have more ideas about above error? Seems adjustEstimate is not supported, but this is not aligned with the API user guide for API2

You should not use adjustEstimate and newEstimate as body parameters. They should be used as query parameters instead accordingly to the documentation. Therefore, use it as parameters to your url variable.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events