It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jython: Search for dashboards


I am currently writing a script that should search for dashboards that are shared globally. I want to find all dashboards with those sharing permissions:

- Shared with anyone on the web
- Shared with logged-in users

I already managed to find all dashboards that are "shared with anyone on the web" with this search parameters:

searchParameters = SharedEntitySearchParametersBuilder().setShareTypeParameter(GlobalShareTypeSearchParameter.GLOBAL_PARAMETER).toSearchParameters() 


But I am struggling to find the fitting search parameters for the second share type (logged-in users). I already tried this.

searchParameters = SharedEntitySearchParametersBuilder().setShareTypeParameter(AuthenticatedUserShareTypeSearchParameter.AUTHENTICATED_USER_PARAMETER).toSearchParameters()

 But I get an error with those parameters:

root cause: Traceback (most recent call last): File "/home/jira/jss/jython/workflow/testmer/", line 35, in <module> searchDashResults =, searchParameters, 0, 20000) at java.util.Objects.requireNonNull( at<init>( at com.atlassian.jira.sharing.type.AuthenticatedUserShareQueryFactory.getQuery( at com.atlassian.jira.sharing.type.AuthenticatedUserShareQueryFactory.getQuery( at com.atlassian.jira.sharing.index.DefaultQueryFactory$1.add( at com.atlassian.jira.sharing.index.DefaultQueryFactory$ at com.atlassian.jira.sharing.index.DefaultQueryFactory.create( at at com.atlassian.jira.portal.DefaultPortalPageManager.lambda$search$1( at com.atlassian.jira.sharing.index.DefaultSharedEntityIndexer.withSearcher( at at at sun.reflect.GeneratedMethodAccessor6835.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( java.lang.NullPointerException: java.lang.NullPointerException

It seems that you have tried to perform an illegal workflow operation.

If you think this message is wrong, please contact your Jira administrators.



This is my current script:

from com.atlassian.jira.bc import JiraServiceContextImplfrom com.atlassian.jira.bc.portal import PortalPageServicefrom com.atlassian.jira.component import ComponentAccessorfrom com.atlassian.jira.portal import PortalPagefrom com.atlassian.jira.sharing import SharedEntityfrom com.atlassian.jira.sharing import SharePermissionImplfrom com.atlassian.jira.sharing.type import ShareTypefrom com.atlassian.jira.sharing.rights import ShareRights from com.atlassian.jira.bc.filter import SearchRequestServicefrom import GlobalShareTypeSearchParameterfrom import SharedEntitySearchParametersBuilderfrom import AuthenticatedUserShareTypeSearchParameterfrom import GroupShareTypeSearchParameter

searchRequestService = ComponentAccessor.getComponent(SearchRequestService)portalPageService = ComponentAccessor.getComponent(PortalPageService)currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()context = JiraServiceContextImpl(currentUser)

# Setting search parametersserviceContext = JiraServiceContextImpl(currentUser)

# GlobalShareTypeSearchParameter.GLOBAL_PARAMETER == "Shared with anyone on the web":
#searchParameters = SharedEntitySearchParametersBuilder().setShareTypeParameter(GlobalShareTypeSearchParameter.GLOBAL_PARAMETER).toSearchParameters()

# Search for dashboards with share setting "Shared with all logged-in users":
searchParameters = SharedEntitySearchParametersBuilder().setShareTypeParameter(AuthenticatedUserShareTypeSearchParameter.AUTHENTICATED_USER_PARAMETER).toSearchParameters()
# Search validationsearchRequestService.validateForSearch(serviceContext, searchParameters)

# Search for dashboards
if searchParameters:
searchDashResults =, searchParameters, 0, 20000)
searchDashResultsList = searchDashResults.getResults()

dashCount = searchDashResults.getTotalResultCount() log.warn("CDSP: Found " + str(dashCount) + " dashboards...")

for dashboard in searchDashResultsList:
dashName = dashboard.getName()

dashPermissions = dashboard.getPermissions()

"CDSP: Found '" + dashName + "' with permissions: '" + str(dashPermissions) + "'")


Could anybody help me here? Any suggestions?
I am running Jira Server 8.5.5 and Jira Scripting Suite 2.8.0



0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,709 views 11 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you