Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to hide fields from Inline edits through Script Runner Behaviour Template

Jyoti Kumari April 3, 2023

Hello Everyone,

I want to hide fields for inline edit through Script Runner Behaviour Template,Kindly guide me how to achieve this.I am able to hide it, when we are clicking on Edit button.

For Example:-

I want to hide priority from editing.

2 answers

2 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Peter-Dave Sheehan
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.
April 3, 2023

@Jyoti Kumari it is not possible to conditionally show/hide fields in the view screen.

All you can do is disable the in-line edit and force the full edit screen to open when someone attempts to in-line edit.

The only way to hide a field from the view screen is to remove it from the field configuration. 

Jyoti Kumari April 4, 2023

@Peter-Dave Sheehan  :- I cannot remove field from view screen, but need to disable from in-line editing .Can you suggest me, how we can achieve this. 

Peter-Dave Sheehan
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.
April 4, 2023

Generally, just the fact of listing a field in a behaviour configuration will generally disallow in-line editing.

But you can call it out explicitly

getFieldByName('some field').setAllowInlineEdit(false)
Peter-Dave Sheehan
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.
April 4, 2023

Note that the in-line edit appears to be available, but if you attempt to click on the field to start editing, you will get the full edit screen pop up.

Jyoti Kumari April 4, 2023

@Peter-Dave Sheehan :- Thank you.It is working fine by using script.Is it possible to not show pencil icon, as showing the pencil icon on the screen and not available that field for the edit is creating bad UI experience for the end users .

0 votes
Answer accepted
Vikrant Yadav
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 3, 2023

Hi @Jyoti Kumari

You need to apply Behaviour on priority field :- 

def priorityField = getFieldById("priority")
priorityField .setAllowInlineEdit(false)
//priorityField.setReadOnly(true)

This script will won't allow editing field from view screen , it opens Edit Screen. 

 Thanks,

Vikrant yadav

Jyoti Kumari April 4, 2023

@Vikrant Yadav :- I have tried this, but it is not working as expected.Its behaviour is inconsistent. 

Like Vikrant Yadav likes this
Vikrant Yadav
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 4, 2023

@Jyoti Kumari  I think you applied script at wrong Field. On my side, it's working fine. Edit screen/dialog box is coming, not allowing to Edit Priority from view screen.Edit in Dialog.pngPriority.png 

Jyoti Kumari April 4, 2023

@Vikrant Yadav :- Thank you so much, for  the detail Information.There was some issue in one of the project, it is not working for every issue ,so I tested it on different project.It is working fine there.

Is it possible to not show pencil icon, as showing the pencil icon on the screen and not available that field for the edit is creating bad UI experience for the end users .

Vikrant Yadav
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 5, 2023

@Jyoti Kumari  I don't think it's possible to hide pencil icon. 

You need to remove field from Edit screen, then only pencil icon get removed. 

Jyoti Kumari April 5, 2023

@Vikrant Yadav  Thank you

Like Vikrant Yadav likes this
TAGS
AUG Leaders

Atlassian Community Events