Hi,
How would I achive the below using Adaptavist's Behaviours Plugin
Scenario:
we have two single line text custom fields. I would like to know if there is anyway to enable/display these two fields to only to none other than one user in the instance.
I was also looking at Javascript options also from other answers, but our users use blockers to block scripts. So I was looking to enforce it from the server-side instead of the client-side.
Any assistance is greatly appreciated.
Hello @Rathna
Try code bellow, placed in behaviours mapped to your project, issuetypes and setted to fields you need.
import com.atlassian.jira.component.ComponentAccessor
def user = ComponentAccessor.getUserManager().getUserByName("username")
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
if (currentUser != user){
//left one depends on your case
getFieldById(getFieldChanged()).setHidden(true) // to be hidden
getFieldById(getFieldChanged()).setReadOnly(true) //to be readonly
}
Discover the teamwork and precision behind success on and off the track. See how this high-performing team makes the impossible possible. Be one of the first 100 customers to register for a chance to win 2 tickets to an Atlassian Williams 2026 race.
Register now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.