Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Dear All, 

I have the following question: one of our user working for years in JIRA. Now he's got a new AD user, wich means new JIRA user. But the problem is, that of course every object (worklogs, assigned tickets, filters, permissions, roles ect) remains at his older user.

Do you know any addon, script, anything, that we can user, to 'change' his old user objects ownership to the new user?

I know, scriptrunner has a part, that can change the ownership of filters and dashboards. That' a good start, but absolutely not enough. Changing every role, permission, assigne would take weeks (although, we would be never sure, if it's fully completed), also the worklogs owner cannot be changed this way.


I'm hoping for any kinf of help :)


Best: Peter

1 answer

1 accepted

0 votes
Answer accepted
Tom Lister Community Leader Jan 09, 2020

Hi @Peter Cselotei - Lupus Consulting Zrt_ 

If your confident with SQL and the Jira database you could try some of the tricks in this article.


Hi @Tom Lister  and thanks for answering.

Unfortunately I have no access to the database (security reasons), also I hardly think that any further answer will come, so I accept this answer, and still hope, some script or addon may come up in the future.



Best: Peter

Tom Lister Community Leader Jan 22, 2020

Hi @Peter Cselotei - Lupus Consulting Zrt_ 

I’ll see if I have any useful groovy scripts.


Hi @Peter Cselotei - Lupus Consulting Zrt_ 


we have this script as a start point for updating comments. When I ran it didn't update but I can't see why from the API notes.

It needs ScriptRunner installed for the JQL query function


import com.atlassian.jira.issue.comments.MutableComment
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.util.UserManager

import com.atlassian.jira.user.ApplicationUser
import org.apache.log4j.Logger
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager

def log = Logger.getLogger("com.cheil.logging")

// **********************************************

// **********************************************
String oldUser = ""
String newUser = ""
def jqlSearch = 'issueFunction in commented("by ' + oldUser + '")'
List<Issue> issues = null
SearchService searchService = ComponentAccessor.getComponent(SearchService.class)
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

def userUtil = ComponentAccessor.getUserUtil()
def commentMgr = ComponentAccessor.commentManager
UserManager userMgr = ComponentAccessor.getUserManager()
ApplicationUser newAppUser = userMgr.getUserByName(newUser)
List<Comment> comments
MutableComment mut
IssueManager issueManager = ComponentAccessor.getIssueManager()

SearchService.ParseResult parseResult = searchService.parseQuery(user, jqlSearch)
if (parseResult.isValid()) {
def searchResult =, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())

searchResult.getResults().each { issue ->
def issueData = issueManager.getIssueObject( (issueData.key)
comments= commentMgr.getCommentsForUser(issueData, user)
comments.each {comment ->
if (commentMgr.isUserCommentAuthor(user, comment)) {"author: " + comment.getAuthorApplicationUser())

try {
commentMgr.update(mut, true)
} catch (Exception e)
}"newAuthor: " + mut.getAuthorApplicationUser())
// issues = searchResult.issues.collect {issueManager.getIssueObject(}
} else {
log.error("Invalid JQL: " + jqlSearch);

I will try this one.thanks

Suggest an answer

Log in or Sign up to answer

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