Show the list of all the users who have project-admin role on project home page.

I want to show the list of all the users/group who have project-admin role on project home page, seemlier the way we have the project lead displayed. I would like to use Script Runner for this. Could you please help me with the groovy code.

1 answer

Hi Manu, 

You can use Script Fragments to create a web panel with the following configuration 

Screen Shot 2017-12-06 at 16.17.56.png

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.Project

def project = context.project as Project
def groupManager = ComponentAccessor.getComponent(GroupManager)

def usersInGroupsWithPermissions = ComponentAccessor.getComponent(PermissionManager).
getAllGroups(Permissions.PROJECT_ADMIN, project)?.
collect { groupManager.getUsersInGroup(it)*.key }?.
collect {userProfileLink(it)}?.

writer.write "Users with Admin permissions for project $project.key <br> $usersInGroupsWithPermissions"

def userProfileLink (String userKey) {
def baseUrl = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL)
def displayName = ComponentAccessor.userManager.getUserByKey(userKey).displayName
<a href="$baseUrl/secure/ViewProfile.jspa?name=$userKey">$displayName</a>

The only issue is that this panel will show you only users in groups with project permissions and not users in project roles with project permissions. 

Please let me know if this helps,


Thanks Thanos, let me try this. however, most of the time individual users are assigned the project role permission under 'Users'. But let me use this.

I am getting the below error while running:

com.atlassian.plugin.PluginParseException: Required resource with name 'view' does not exist.

at com.atlassian.plugin.web.descriptors.WebPanelSupplierFactory.


at com.atlassian.plugin.web.descriptors.WebPanelSupplierFactory.


at com.atlassian.plugin.web.descriptors.DefaultWebPanelModule


at com.atlassian.plugin.ModuleDescriptor$init$ Source)

at com.atlassian.plugin.ModuleDescriptor$init$ Source)

at com.onresolve.scriptrunner.fragments.FragmentsManager.


at com.onresolve.scriptrunner.fragments.FragmentsManager.


at com.onresolve.scriptrunner.fragments.IFragmentsManager

$ Source)

at com.onresolve.scriptrunner.fragments.AbstractCustomWebPanel.


at com.onresolve.scriptrunner.canned.CannedScript$

(Unknown Source)

at com.onresolve.scriptrunner.canned.CannedScript$

(Unknown Source)

at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.validate


at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runCanned


I am using version ( of SR


I would like to return all the user names under the project role >> groups with project admin permission as a comma delimited string.

@Thanos Batagiannis [Adaptavist] Can you please update. as it's giving me an error.

@Thanos Batagiannis [Adaptavist] Can you please update. If i am using the method "getAllGroups" than should i use the (Permission ID[int]). If yes, than in my initial query, i want to show the list of users/groups under role project Admin(10050). Can you please modify an above query.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

415 views 0 3
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you