The CreatorCon Call for Content is officially open! Get started here.

How to Hide Comment Field on the portal

Community Alums
Not applicable

We have a requirement to hide the comment field from the portal for the HR Cases.

If the HR Cases are on closed state then the comment field should be hidden for the users , as of now it is not working like that.

asmitasahu_0-1684161049509.png

 

For incident and RITM it is working as expected , if incident is closed then the field is not visible to users.

We are using the same OOB widget for all requests. i.e., Standard ticket tab

Can you please help me to find out from where the field is getting hidden for incident OR how can we hide it for HR cases.

Thanks in advance.

 

1 ACCEPTED SOLUTION

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

You can amend the respective ACLs for sn_hr_core_case.comments with an active=true filter or any other condition you need. No need to touch the widget.

View solution in original post

6 REPLIES 6

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

You can amend the respective ACLs for sn_hr_core_case.comments with an active=true filter or any other condition you need. No need to touch the widget.

Community Alums
Not applicable

Hi Laszlo,

 

I tried your provided solution but it is not working.

Can you please provide any other?

Can you please share the ACL you have configured?

Is it possible that there is ANOTHER ACL that allows the user to write comments on closed cases?

Community Alums
Not applicable

Hi @Laszlo Balla 

 

There is one existing OOB Write ACL on comment field in which one script is written.

answer = false;
if (!new hr_CoreUtils().impersonateCheck()) {
var roles = new hr_Utils();
 
if (roles.checkUserHasRole(hr.ROLE_HR_CASE_WRITER))
answer = true;
else {
var hrCase = new hr_Case(current, gs);
if (hrCase.canEditCase() || hrCase.isApproverUserForCase(gs.getUserID()) || sn_hr_core.hr_Case.userHasSubjectPersonAccess(current))  
answer = true;
}
}
 
I have created write ACL on comment field with filter active= true