Only allow users in group to edit custom field when status transitions to Done

Natasha Richardson March 29, 2023

Hi all,

I am on Jira Software for Cloud. A user wants editing of a custom field to be restricted to a particular group. The field is only used when the issue is resolved. I can add the field to a Resolve screen but that still won't limit editing of just that field to users in a certain group on the view/edit issue screen, right?

I'm not finding any solutions for this except for creating transitions screens etc. just wondering if there is a better way to accomplish this that anyone has experience with?

https://community.atlassian.com/t5/Jira-questions/Custom-field-edit-restriction-based-on-user-role-permission/qaq-p/2031575

https://community.atlassian.com/t5/Jira-questions/Setting-user-group-permissions-on-a-custom-field-in-JIRA/qaq-p/313497

Thanks

Natasha

1 answer

Natasha Richardson March 29, 2023

I believe that is to prevent editing of the issue in its entirety right? Not just a particular field.

Joel Batac March 29, 2023

Yes, only mentioned group can edit the issue in that status (in this case Done). Per your statement - " The field is only used when the issue is resolved", - then you can apply this since the field is only available when it is resolved. 

 

 

Or if you want, you an use Behaviour. Something like,

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
def fieldname = getFieldById("customfield_xxxx")
// Get the current user
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

if (ComponentAccessor.getGroupManager().getGroupsForUser(currentUser)?.find { it.name in ["Name of the Group"]} && getFieldScreen().name == "Name of your resolve screen") {
//log.warn('ok')
//return true
fieldname,setHidden(false)
} else {
fieldname,setHidden(false)
}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events