Is the add worklog API working as expected with 'author'?

Hello, we are using the 'Cloud' version of Jira and I'm trying to add a worklog to a ticket programatically.  The issue I'm having is that I would like to use a "system account" to call the API and then associate the worklog with the user I specify in the request. As documented here  this appears to be supported by adding an "author" and "updateAuthor" object to the POST.  However, when I do that, the response I get consistently has the user that I authenticated against the API with as the "User" associated with the worklog as opposed to the one I specified in the request.

Here are the steps to reproduce what I'm trying to describe:

  1. Create request with user "bob" credentials.
  2. Call "add worklog" with an object like this:
{ comment: 'I did some work here.', started: '2017-09-29T09:00:00.000+0000', timeSpentSeconds: 7200, author: joe, updateAuthor: joe }

where 'joe' is a user object as specified in the doc like this (real account info replaced with fake values):

{ name: 'joe', key: 'joe', accountId: 'some-id', emailAddress: 'joe@email.com', avatarUrls: { '16x16': 'https://avatar-cdn.atlassian.com/', '24x24': 'https://avatar-cdn.atlassian.com/', '32x32': 'https://avatar-cdn.atlassian.com/', '48x48': 'https://avatar-cdn.atlassian.com/' }, displayName: 'Joe', active: true, timeZone: 'America/Los_Angeles' }

The API call succeeds but returns this (again, real account info replaced with fake values):

{ self: 'https://atlassian.net/rest/api/2/issue/59424/worklog/44955',  author:   { self: 'https://atlassian.net/rest/api/2/user?username=bob',      name: 'bob',     key: 'bob',     accountId: ‘bobs-account-id',     emailAddress: ‘bob@email.com',      ... },  updateAuthor:     { self: 'https://atlassian.net/rest/api/2/user?username=bob',     name: 'bob',     key: 'bob',     accountId: ‘bobs-account-id',     emailAddress: ‘bob@email.com',      ... },  comment: 'I did some work here.',  created: '2017-10-03T11:15:30.431-0600',  updated: '2017-10-03T11:15:30.431-0600',  started: '2017-09-29T03:00:00.000-0600',  timeSpent: '3h',  timeSpentSeconds: 10800,  id: '44955',  issueId: '59424' }

Note that the 'author' and 'updateAuthor' have both been returned as the user "Bob" instead of "Joe" which I posted in the request.

I've poked around the docs for quite a while trying to figure out what I may be doing wrong but I'm just not seeing it.  Can someone confirm that the API is working the way it should or let me know if this is an unreported bug?  Any help appreciated, thanks!

1 answer

Hi Joe,

From JRASERVER-30197 and JRACLOUD-30197 it doesn't look like you're doing anything wrong.  Take a look at the Product Manager's response that I linked.

Please vote on JRASERVER-30197 and JRACLOUD-30197 to add your use case to the comments so we can add impact and get traction on this.

Cheers,

Branden

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 21, 2018 in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

1,243 views 10 18
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