WorkLog Pro API Create Worklog 400 - Bad Request

Brian Dougherty November 9, 2020

We recently migrated our Jira with WorkLogPro to a new server. One of our API calls to WorkLog pro no longer works. When attempting to create a new worklog entry we receive 400 - bad request with an empty response body. We are able to update an existing worklog entry and pull worklog time for employees. We just cannot post a new worklog. If we change the URL to our test server the post works so we are convinced the json syntax is correct. Here is the payload:

{

    "issueKey""HR-1",

    "workStart""2020-11-10T12:00:00+0000",

    "timeSpent"28800,

    "authorUserKey""john.doe",

    "comment""Vacation - 8 hours",

    "adjustEstimate""auto",

    "workLogAttributes": [

        { 

           "attrTypeId"1,

            "attrValue""18"

        }

    ]

}

 

The URL: https://jiraopt.xxx.com/rest/com.deniz.jira.worklog/1.0/worklog

The response (empty):

{}

Oddly if we purposefully adjust the payload to include a bad value, such as a non-existent attribute, the API will return the following, indicating we are able to reach the server:

{

    "localizedMessage""187 is not valid for attribute:Activity",

    "message""187 is not valid for attribute:Activity"

}

The log on the server shows our API user as authenticating when the request is made. 

Any Ideas?

Thanks Brian.

1 answer

1 accepted

0 votes
Answer accepted
Deniz Oğuz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 9, 2020

Hi Brian,

Can you specify which version of WorklogPRO you are using? Also can you increase log level of WorklogPRO, try again and check the logs. This may show more information. Are you sure authorUserKey is correct? May be you need to use authorUsername instead? For newer versions of Jira, user keys are completely different than usernames.

Brian Dougherty November 9, 2020

Worklog Pro 4.7.0. 

 

I enabled the log - here are the results:

Removed log because it contains user info.

Deniz Oğuz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 9, 2020

Hi Brian,

Can you try to create an account and also set accountId attribute on your request? You don't need to associate the account with any project so it will not be visible on worklog dialog. This is a temporary workaround. It seems that our Rest API requires accountId but it should be optional. We will fix this as soon as possible. Sorry for the inconvenience. You can also delete log file content in your previous reply, it contains your username, issue key and may be other private information. 

Brian Dougherty November 9, 2020

Thank you Deniz. Adding the account to Worklog Pro and adding the accountID to the API called resulted in a successful post. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events