Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide the comment field only in the Edit screen and not the View screen

Tom L
June 11, 2018

I have a requirement to hide the comment field in the Edit screen.  I was able to hide it using the following Behaviours script:

def commentField = getFieldById(getFieldChanged())

if (getFieldScreen().name == "My Edit Screen" && !getActionName())

{ // check if on edit screen
commentField.setHidden(true)
}

But, the problem is that it is also hiding the comment field in the View screen, which I do not want.

For example, after I open/dismiss the Edit screen and clicked on the "Comment" button in the "Comments" tab in the View screen, the "Comment" button disappeared.  Also clicking on the "Comment" button under the Summary in the View screen has no affect.

If I refresh the browser, the "Comment" button appears again in the "Comments" tab, and clicking on it will display the comment field.

Anyone knows how to hide the comment field in the Edit screen without affecting the comment field in the View screen?

 

1 answer

0 votes
Karie Kelly
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 Champions.
September 24, 2012

Is that custom field configured for all issue types and global projects?

If it is configured for only specific issues types or specific projects, then your filter can only contain those specific issue types and/or projects. Unfortunately, the field won't display, and just have null values, if not all issues are configured for it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events