Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Symptoms:

The dashboard “dashboard” for active user <user> does not exist.  For the solution presented, I cannot modify the dashboard to clear the error as it does not exist

Cause:

The CMJ user does not have share permissions to access this dashboard.

Resolution 1:

Use the following Groovy script to make only a dashboard with specified ID on the system be accessible to the "jira-administrators" group:

Code Block
languagegroovy
titleMake dashboards accessible to admin
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.portal.PortalPage
import com.atlassian.jira.portal.PortalPageManager
import com.atlassian.jira.sharing.SharePermission
import com.atlassian.jira.sharing.SharePermissionImpl
import com.atlassian.jira.sharing.SharedEntity.SharePermissions
import com.atlassian.jira.sharing.type.ShareType.Name
import com.atlassian.jira.util.collect.EnclosedIterable.Functions;


def makeDashboardAccessibleToAdmin(long dashboardId) {
	PortalPageManager ppm = ComponentAccessor.getComponent(PortalPageManager.class);
    
	PortalPage portalPage = ppm.getPortalPageById(dashboardId); 
	Set<SharePermission> permissionsSet = new HashSet<SharePermission>(
		portalPage.getPermissions().getPermissionSet()
	);
	permissionsSet.add(new SharePermissionImpl(null, Name.GROUP, "jira-administrators", null));
	ppm.update(PortalPage.portalPage(portalPage).permissions(new SharePermissions(permissionsSet)).build());
}

makeDashboardAccessibleToAdmin(DASHBOARDIDHERE);


Resolution 2:

It is possible that you don’t have permissions to access it (share permissions). You can use a this groovy script to make all dashboards global.

NB! makeAllDashboardsGlobal returns the ids of all changed dashboards. This list can be used to revert the changes, so save it!

...