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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Work log author name wrong

Hi Support,

We tried to get work log from Jira API. However, we found that certain work log throw wrong author name as the it's username.I found that in the app_user table, the user's user_key is the same as the author name so I changed that to be the same as current username. 

However, it still doesn't update in the work log. 

Please advise,

1 answer

0 votes
Andy Heinzer Atlassian Team Jul 18, 2017

So the app_user.user_key field will match the username in JIRA when the account is first created in JIRA.  But if that account has ever been renamed in JIRA, then the cwd_user table gets updated with the new values (along with the app_user.lower_user_name value) while the app_user.user_key field is expected to remain the same in JIRA, forever.   

If you modified that field directly via SQL then I fear you might have messed with the way JIRA is storing that historical information such as worklogs and issue edit history.

But back to the worklog problem, I think you are seeing a known bug in JIRA JRASERVER-36642

The good news is that there is a workaround for this on that bug ticket:

 


Use the /rest/api/2/user endpoint to retrieve the user's username based on its key. This should return something like:

 

{
    "active": true,
    "avatarUrls": {
        "16x16": "http://localhost:8080/jira/secure/useravatar?size=xsmall&avatarId=10122",
        "24x24": "http://localhost:8080/jira/secure/useravatar?size=small&avatarId=10122",
        "32x32": "http://localhost:8080/jira/secure/useravatar?size=medium&avatarId=10122",
        "48x48": "http://localhost:8080/jira/secure/useravatar?avatarId=10122"
    },
    "displayName": "Matheus Fernandes",
    "emailAddress": "mfernandes@atlassian.com",
    "expand": "groups",
    "groups": {
        "items": [],
        "size": 7
    },
    "key": "matheus",
    "locale": "en_US",
    "name": "mfernandes",
    "self": "http://localhost:8080/jira/rest/api/2/user?username=matheus",
    "timeZone": "Brazil/East"
}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Happy New Year and Welcome New Marketplace Partner Program Partners!

Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...

813 views 7 24
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