Hide custom field on view screen

Dan27 January 22, 2019

Hello,

I need to hide a custom fields (Select List , Text Field , Scripted Field) from all of the users- instead 2 users.

Is it possible to do it on Behaviours? This is my code and it's now working on view screen:

 

import com.atlassian.jira.component.ComponentAccessor;

def Source = getFieldById("customfield_11507")

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
log.warn user
if(user!='dmor(dmor)')
{
Source.setRequired(false)
Source.setHidden(true)
}

 

2 answers

1 vote
Jamil Rahimov
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.
February 13, 2019

@Dan27

1.Please try Advanced Edit.
1.PNG//------------------------------------------------------------------------------------------------

2.Then configure your field behaviour:
   - Change hidden to true
   - Add these 2 users to new group and add this group to behaviour.
2.PNG

Sayan Kaiser December 2, 2020

There is no advanced edit option on behaviour plugin now 

1 vote
Neta Elyakim
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 22, 2019

You can use this built-in ability (with Behaviour)

1.PNG2.PNG:

Dan27 January 22, 2019

Hi @Neta Elyakim ,

I can't do it cause this is not a system field.

source.JPG

Neta Elyakim
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 22, 2019

As you can see in my example- I'm not using a system field.

You don't need to mark the "Shown" (after you've marked it called "Hidden"), look at my marks in the screenshot. 

Dan27 January 22, 2019

Hi @Neta Elyakim ,

It's not working... The different user still can see the field.

Like # people like this
Sayan Kaiser December 2, 2020

Hi Neta,

This is not working, and the advanced edit option is no longer present on the plugin

Suggest an answer

Log in or Sign up to answer