Is that possible to migrate dashboard, filter from one user to another JIRA user

Jay Gao March 19, 2013

hi team,

One user's account has been marked deleted in Crowd which is for our JIRA SSO. And the user could not log into JIRA any more.

Now we want to query out all dashboards and filters which this user subscribed in JIRA and migrate them to new JIRA account.

Is that possible to do migration through UI?

Thanks!

Jay

5 answers

1 accepted

1 vote
Answer accepted
Henning Tietgens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2013

Changing the owner of a private filter is not possible. You could use the Script Runner plugin and the following script to copy the filters from the old user to another user.

import com.atlassian.jira.issue.search.SearchRequest
import com.atlassian.jira.util.SimpleErrorCollection
import com.atlassian.jira.bc.JiraServiceContextImpl

oldUser = 'olduser'
newUser = 'newuser'

result = ''
userUtil = componentManager.getUserUtil()
jsc = new JiraServiceContextImpl(userUtil.getUser(newUser),new SimpleErrorCollection(),componentManager.jiraAuthenticationContext.i18nHelper)
srs = componentManager.getSearchRequestService()
filters = srs.getOwnedFilters(userUtil.getUser(oldUser))
result += "Found ${filters.size()} filters for user $oldUser.\n"
filters.each {
    newFilter = new SearchRequest(it.query, newUser, it.name, it.description)
    srs.validateFilterForCreate(jsc,newFilter)
    if (jsc.errorCollection.errorMessages.size()==0) {
        sr = srs.createFilter(jsc,newFilter)
        if (sr) {
            result += "Created filter ${srs.createFilter(jsc,newFilter)?.name} for $newUser.\n"
        } else {
            result += "Filter could not be created: ${jsc.errorCollection.errors}\n"
        }
    } else {
        result += "Filter creation validation failed: ${jsc.errorCollection.errors}\n"
    }
}
result

Henning

Jay Gao March 26, 2013

Hi Henning,

We asked the user to re-create his private filters and dashboards. Anyway, thanks for your help! Your script might be a good workarround. I saved it, and believe it will be helpful for the next time.

Thanks!

Jay

1 vote
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2013

Also see https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Changedashboardorfilterownership . Given a dashboard, it will also change ownership of any filters that are used in that dashboard, if they are not visible to the person you are updating it to. Can multiselect filters and dashboards too.

Jay Gao March 21, 2013

Jamie,

Good to know the script there! It seems it's not possible to handle with private filter. And private filter seems could not be retrieved by JIRA administrators

Thanks!

Jay

0 votes
Henning Tietgens
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 20, 2013

It depends on the JIRA version you are using. In 5.1.8 it's possible to change the owner of a dashboard or filter through the corresponding menu items "Shared Filters" and "Shared Dashboards" under the "Users" administration menu. If you want to search for the filters or dashboards of the deactivated user you have to enter the username manually because the user is not in the list anymore.

Henning

Jay Gao March 21, 2013

Henning, unfortunately, we are using JIRA 5.0.6 and trying to migrate some private filters...I found private filter even could not be quired out by JIRA system admin.

0 votes
Jay Gao March 20, 2013

Ok! We have to ask user to re-subscribe/re-create filters.
Actually the enhancement here could help us, but unfortunately, it's still
unimplemented.
https://jira.atlassian.com/browse/CWD-1133

Anyway, thanks Janet!

0 votes
Janet Albion
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 19, 2013

Hi Jay,

The owner of the dashboard or filter can't be modified in the UI. If the dashboard or filter is accessible by the new account, then the user can copy those and use the copy instead

Suggest an answer

Log in or Sign up to answer