How can I disable the 'Labels' option from 'More Actions' menu

Janet Juo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 9, 2020

I would like to disable 'Labels' option from 'More Actions' menu (as picture below), because I can't find this 'Labels' field at the custom field page, and also can't display this field on the issue view screen. Please help me on how to achieve this. Thanks

 

jira lable.JPG

2 answers

1 accepted

0 votes
Answer accepted
Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 19, 2021

@Janet Juo I should have added,

This is the way, If you have the script runner plugin, you can do this.

1. Install the script runner plugin(paid) at the Atlassian market place
https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira\

2. Go to Manage Apps > SCRIPT RUNNER > Fragments > Create Script Fragments > Hide system or plugin UI element

3. Under Hide what "Type label > the module key for the web item is com.atlassian.jira.plugin.system.issueoperations:edit-labels

4. Under conditions enter the below ( it will hide the labels button in only this project.

jiraHelper.project?.key != "PROJECTKEY"


5. If you want to hide for all users in the project except for jira-adminstrators the enter the condition below



import com.atlassian.jira.component.ComponentAccessor
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def userUtil = ComponentAccessor.userUtil
def groupName = "jira-administrators"


userUtil.getGroupNamesForUser(currentUser.name).contains(groupName) || jiraHelper.project?.key != "PROJECTKEY"

 

Kind regards,

Moses

Marco Brundel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2022

Hi @Moses Thomas ,

Do you know if it is also possible not to show it based on project role instead of user group?

Regards, Marco

Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2022

Hello Marco,

You could use  the condition

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.web.action.ProjectActionSupport
import com.atlassian.jira.project.Project
import com.atlassian.jira.security.roles.ProjectRoleManager
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()


ProjectActionSupport projectSupport = new ProjectActionSupport();
Project currentProject = ComponentAccessor.getProjectManager().getProjectObj(projectSupport.getSelectedProjectId());

def projectRoleManager = ComponentAccessor.getComponentOfType(ProjectRoleManager)
def role = projectRoleManager.getProjectRole("Administrators")
return ( projectRoleManager.isUserInProjectRole(currentUser, role, currentProject) || jiraHelper.project?.key != "PROJECTKEY" )

Kind regards,

Moses

Like Marco Brundel likes this
Marco Brundel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2022

Hi @Moses Thomas ,

Thank you, it works!!

regards, Marco

Like Moses Thomas likes this
Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2022

Hi Marco,

You welcome!

Kind regards,

Moses

Like Marco Brundel likes this
1 vote
Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 9, 2020

@Janet Juo  No for now  you can't.

 

Best regards,

Moses

Suggest an answer

Log in or Sign up to answer