cancel
Showing results for 
Search instead for 
Did you mean: 
Community_Admin
Community Team Member
Community Team Member

In case when you need to change the owner of multiple dashboards there are few ways:

1) In case all the dashboards are in 1 folder then you can select the folder and export the dashboards.

Community_Admin_0-1634625106912.png

 

 

 After what, import the dashboards back under the user to whom you would like to transfer the dashboards. In this case you will need to republish the dashboards to users to whom they were shared before.

2)  Change the user email in the user profile under Admin tab-> Users  - ONLY to a new user. This option will not merge the accounts!

3)Use the script below under Sys.Admin in Web Developers console (F12 in Chrome)

Note, Dashboards and Elasicubes must be shared in advance!

var newOwnersId = "5e5cdc80ecebb629e0c8de85" //New owner, use the REST API to get user ID

$.ajax({

   url: '/api/v1/dashboards?fields=oid,owner',

   success: function(res) {

          console.log(res)

       var dashboards = res.filter(function(dash) {

           return prism.user._id === dash.owner

       })

       var dashboardsList = [];

       dashboards.forEach(function(dashboard) {

           dashboardsList.push(dashboard.oid)

       })

       if (dashboardsList.length) {

           changeOwnership(dashboardsList)

       }

   }

})

function changeOwnership(dashboardsList) {

   var succeed = [];

   var failed = []

   dashboardsList.forEach(function(dash) {

       $.ajax({

           method: 'POST',

           contentType: 'application/json',

           data: JSON.stringify(

               {

                 "ownerId": newOwnersId,

                 "originalOwnerRule": "edit"

               }

           ),

           url: '/api/v1/dashboards/' + dash + '/change_owner?adminAccess=true',

           async: false,

           success: function(res) {

               succeed.push(dash)

           },

           error: function(res) {

               failed.push(dash)

           }

       })

   });

   console.log('Dashboard\'s owner was changed successfully for: ');

   console.log(succeed);

   console.log('Dashboard\'s owner wasn\t changed successfully. Please, try to change owner manually for: ');

   console.log(failed);

}



Version history
Last update:
‎10-18-2021 11:32 PM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Need additional support?:

Community Support Request