Last active
August 29, 2015 14:07
-
-
Save petrolmer/1280d21e1488f243f338 to your computer and use it in GitHub Desktop.
Turns saved views on/off on all dashboards for the specified list of projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gooddata' | |
require 'json' | |
# 1 = turn on, 0 = turn off | |
SAVED_VIEWS = 1 | |
# includes list of project ids | |
FILENAME = 'projects.txt' | |
# enter your credentials here or call simply connect() to use credentials from your auth store | |
client = GoodData.connect('ENTER PLATFORM USER', 'ENTER PASSWORD') | |
File.open(FILENAME).each do |pid| | |
project = client.projects(pid) | |
project.dashboards.each do |dashboard| | |
dashboard.json['projectDashboard']['content']['rememberFilters'] = SAVED_VIEWS | |
dashboard.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment