Custom web item only for specific role in a specific project Edited

I want that only a specific role in a specific project can see the link in the in jira. how should the condition look like?

this link is for the service-desk-agents in a service desk project. they can quickly open the queues with that. if i leave the condition blank every user can see this link. but i want only this menu-point. only the agents in this service-desk-project should see the link.


1 answer

1 accepted

This widget could not be displayed.
Alexey Matveev Community Champion Nov 03, 2017


The codition would look somthing like this

import com.atlassian.jira.component.ComponentAccessor

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def projectRoleManager = ComponentAccessor.getComponentOfType(ProjectRoleManager)
def project = ComponentAccessor.getProjectManager().getProjectByCurrentKey("ProjectKey")
ProjectRole administratorProjectRole = projectRoleManager.getProjectRole("RoleName");
if (projectRoleManager.isUserInProjectRole(user, administratorProjectRole, project)) {
return true
} else {
return false

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

292 views 5 0
Join discussion

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