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

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
Henning Tietgens Community Champion Mar 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

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

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.

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 vote
Janet Albion Atlassian Team Mar 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

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 vote
Henning Tietgens Community Champion Mar 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

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

243 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you