Skip to main content
1-Visitor
February 7, 2018
Solved

Get Dashboards of a specific User

  • February 7, 2018
  • 2 replies
  • 2054 views

Is there a way to get all the dashboards that were created by a specific user by script?

This would be very useful as I would like to delete all the dashboards that were created by a user when this user is deleted.

Best answer by CarlesColl

This is an approximation:

var result = Resources["DashboardFunctions"].SearchAllDashboards();

result.AddField({name: "owner", baseType: "STRING" });

var creator

for each(row in result.rows) {

   creator =  Dashboards[row.id].GetConfigurationChangeHistory().Find({ changeAction: "CREATE" });

    if (creator!=null) {

        row.owner = creator.user;

    }

}

2 replies

1-Visitor
February 7, 2018

This is an approximation:

var result = Resources["DashboardFunctions"].SearchAllDashboards();

result.AddField({name: "owner", baseType: "STRING" });

var creator

for each(row in result.rows) {

   creator =  Dashboards[row.id].GetConfigurationChangeHistory().Find({ changeAction: "CREATE" });

    if (creator!=null) {

        row.owner = creator.user;

    }

}

IPA1-VisitorAuthor
1-Visitor
February 8, 2018

Thank you very much, Carles! This is what I was looking for.