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.

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<br/><span class="c-mrkdwn__br" data-stringify-type="paragraph-break"></span>$.ajax({<br/> url: '/api/v1/dashboards?fields=oid,owner',<br/> success: function(res) {<br/> console.log(res)<br/> var dashboards = res.filter(function(dash) {<br/> return prism.user._id === dash.owner<br/> })<br/> var dashboardsList = [];<br/> dashboards.forEach(function(dashboard) {<br/> dashboardsList.push(dashboard.oid)<br/> })<br/> if (dashboardsList.length) {<br/> changeOwnership(dashboardsList)<br/> }<br/> }<br/>})<br/><span class="c-mrkdwn__br" data-stringify-type="paragraph-break"></span>function changeOwnership(dashboardsList) {<br/> var succeed = [];<br/> var failed = []<br/> dashboardsList.forEach(function(dash) {<br/> $.ajax({<br/> method: 'POST',<br/> contentType: 'application/json',<br/> data: JSON.stringify(<br/> {<br/> "ownerId": newOwnersId,<br/> "originalOwnerRule": "edit"<br/> }<br/> ),<br/> url: '/api/v1/dashboards/' + dash + '/change_owner?adminAccess=true',<br/> async: false,<br/> success: function(res) {<br/> succeed.push(dash)<br/> },<br/> error: function(res) {<br/> failed.push(dash)<br/> }<br/> })<br/> });<br/> console.log('Dashboard\'s owner was changed successfully for: ');<br/> console.log(succeed);<br/> console.log('Dashboard\'s owner wasn\t changed successfully. Please, try to change owner manually for: ');<br/> console.log(failed);<br/>}
fxs7576
·2 years agoThat explains it. Thank TriAnthony !
Tri Anthony
·2 years agoHi fxs7576,
adminAccess=true is needed to access dashboards that are not explicitly shared to the admin user that you are using to call the API. In the case of changing ownership, even if the dashboards are explicitly shared with the admin user, adminAccess=true is still needed to change the ownership of dashboards that the admin user is not the owner of.
Let me know if this is helpful.
-Tri
fxs7576
·2 years agoHi intapiuser ,
Really appreciate for sharing this information.
For the changing ownership of the dashboard endpoint, I'm wondering if you know at what point the value of adminAccess should be true.
On some occasions, I received the following message after running that endpoint:
pb_si
·2 years agoThanks, a lot of effort to pull this together!
This could work for a 1-off scenario, but I don't think it would be practical in general use 😞
Feels like a something that would be best/easiest addressed in the core product?