Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

WorkLog Pro API Create Worklog 400 - Bad Request

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

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.

Worklog Pro 4.7.0. 

 

I enabled the log - here are the results:

Removed log because it contains user info.

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. 

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
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

342 views 3 14
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you