Hey everyone,
We migrated to a new domain controller resulting in everyone getting new user names. This means our new user names don't have ownership of our old items (pages, dashboards, filters, etc). As an admin, I can bulk change some fields in Jira, but others are done one at a time. Additionally, I can access anything that was shared and adjust them manually. I'm hoping to find a way to change those items (pages, dashboards, filters, etc) which are not shared. The title says script but it doesn't have to be that. I've already moved most of what we need but I'd like to catch everything else just in case something will be needed in a few months at the next milestone.
I've seen a few other posts similar to this but wanted to bring it up again in case someone has something new to add.
Thank you
It sounds like you have already cutover to the new DC / username format - and if so, the below process will not work, however doing a write up in case it's not too late, or for future reference for others. We've done this type of "shuffle" many times - and it's worked well.
YMMV / use at your own risk / please attempt in a non-production environment first. </disclaimers>
For the below examples, let's assume that:
Steps:
Hope that helps.
CCM
We have already cutover to the new DC, which has been in place for a few months with everyone using their new accounts. I have manually changed ownership for most objects, but there are some corner cases that I cannot reach.
Are y'all aware of any way to modify unshared objects?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Baxter,
Huge disclaimer on the below - these are updates directly in the DB and are NOT supported or recommended by Atlassian, however we have used these a number of times with success to resolve issues where data "had" to be reassigned from old to new users. These queries only handle native Jira objects (eg: plugins will not be changed).
After you've run these queries, the caches are going to be out of sync, so restarting your Jira app nodes (one at a time if you're on DC) will get things up to date.
You need to run these for each user - <new username> will be your DC/email address, username, <duplicate username> will be the old DC/non-email username
UPDATE userhistoryitem SET USERNAME =
'<new username>'
WHERE USERNAME =
'<duplicate username>'
;
UPDATE fileattachment SET AUTHOR =
'<new username>'
WHERE AUTHOR =
'<duplicate username>'
;
UPDATE jiraissue SET REPORTER =
'<new username>'
WHERE REPORTER =
'<duplicate username>'
;
UPDATE jiraissue SET ASSIGNEE =
'<new username>'
WHERE ASSIGNEE =
'<duplicate username>'
;
UPDATE jiraissue SET CREATOR =
'<new username>'
WHERE CREATOR =
'<duplicate username>'
;
UPDATE customfieldvalue SET STRINGVALUE =
'<new username>'
WHERE STRINGVALUE =
'<duplicate username>'
;
UPDATE jiraaction SET UPDATEAUTHOR =
'<new username>'
WHERE UPDATEAUTHOR =
'<duplicate username>'
;
UPDATE jiraaction SET AUTHOR =
'<new username>'
WHERE AUTHOR =
'<duplicate username>'
;
UPDATE changegroup SET AUTHOR =
'<new username>'
WHERE AUTHOR =
'<duplicate username>'
;
UPDATE worklog SET AUTHOR =
'<new username>'
, UPDATEAUTHOR =
'<new username>'
WHERE AUTHOR =
'<duplicate username>'
;
Based on the table names, it should be relatively obvious what data you're changing. I always like to run a SELECT * with the same WHERE clause to sanity check the data before running the updates.
Again, recommend you try this on a non-prod environment first.
CCM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.