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
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.
https://community.atlassian.com/t5/Migrations-articles/Jira-LDAP-Migration-using-SQL/ba-p/942752
Tom
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.
Thanks!
Best: Peter
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.
Hi @Peter Cselotei - Lupus Consulting Zrt_
FYI
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.bc.issue.search.SearchService
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 = "old@domain.com"
String newUser = "new@domain.com"
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()) {
// searchService.search()
def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
searchResult.getResults().each { issue ->
def issueData = issueManager.getIssueObject(issue.id)
log.info (issueData.key)
comments= commentMgr.getCommentsForUser(issueData, user)
comments.each {comment ->
if (commentMgr.isUserCommentAuthor(user, comment)) {
log.info("author: " + comment.getAuthorApplicationUser())
mut=commentMgr.getMutableComment(comment.getId())
mut.setAuthor(newAppUser)
try {
commentMgr.update(mut, true)
} catch (Exception e)
{
log.info(e.getMessage())
}
log.info("newAuthor: " + mut.getAuthorApplicationUser())
}
}
}
// issues = searchResult.issues.collect {issueManager.getIssueObject(it.id)}
} else {
log.error("Invalid JQL: " + jqlSearch);
}
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.