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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Schuster
Posted Mar 28, 2018 in Jira Software

Can a company’s culture make or break agile adoption?

Can a new-to-agile team survive and thrive in a non-agile culture? If so, what advice would you give to those trying to be agile in a non-agile culture? What's the key(s) to success? Share your thoug...

12,058 views 15 13
Join discussion

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