Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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



1 answer

Hi Marius,

have you managed to get it working?
I'm in the same situation. Need to find all Filters shared with Any logged in User.

Any help is appreciated.


Hi Markus,

I managed to find out about those using a database query, directly on our Jira server.

General example:

select * from sharepermissions where entitytype='PortalPage'

This will get all dashboards (=PortalPage). The same query can be used for filters. You will get a query result showing the sharetype. For example group or loggedin. After that you can add this to your query and search only for those.

select * from sharepermissions where entitytype='PortalPage' and sharetype='loggedin'



Hi Marius,

thank your for that tip.
I just got a reply from Adaptavist support.


SELECT * FROM sharepermissions WHERE entitytype IN ('SearchRequest','PortalPage') AND sharetype = 'loggedin';

 Replace with Group

UPDATE sharepermissions SET sharetype = 'group', param1 = '<group name>' WHERE sharetype = 'loggedin' AND entitytype IN ('SearchRequest'); 


And an idea for the API

import com.atlassian.jira.bc.filter.SearchRequestService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.sharing.SharedEntity
import com.atlassian.jira.sharing.type.ShareType
import com.atlassian.jira.sharing.SharePermissionImpl
def searchRequestService = ComponentAccessor.getOSGiComponentInstanceOfType(SearchRequestService.class)
def user = ComponentAccessor.userManager.getUserByName('<username>')
def searchRequests = searchRequestService.getOwnedFilters( (com.atlassian.jira.user.ApplicationUser) user)
searchRequests.each {
 def isshared = 0
 it.getPermissions().getPermissionSet().each {
    if( it.getType() == ShareType.Name.AUTHENTICATED ) {
if (isshared > 0 ) {
    log.error it.getName()
    log.error it.getPermissions()

how to construct SharePermission? (


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

340 views 1 5
Read article

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