Hide/Disable 'Post Comments' button in Agent Workspace

Shivam Saxena1
Mega Expert

Hello,

 

I got a requirement where I need to permanently hide/disable 'Post Comments' button present in Compose section of Agent Workspace.

find_real_file.png

I am not getting from where this 'Post Comments' button is coming.

The requirement to hide this 'Post Comments' button arises because there is a functionality in the form where if you write any unwanted word in comments section then an alert will come as soon as you write the word in comments section. This is working fine in platform view but in agent workspace we need to click out of the box to get that alert message so if I write any unwanted word inside the comments box and will not click out of the box and directly click on 'Post Comments' button then alert will not come and the comment will get posted.

(this unwanted words we have stored in a table and we are fetching the words on change of comments field).

Can someone please help me on this?

 

Thanks.

4 REPLIES 4

Colin10
Tera Contributor

I have been looking for a solution to this for a while, as it appears many have. But I believe I have worked it out.
Create a new ui policy on the table or tables required, with no condition, and add a ui policy action to make work_notes field mandatory - example:

Colin10_0-1665068734274.png

When you check back on the workspace you will see that both buttons for comment and work notes have gone:

Colin10_1-1665068840147.png

Of course, it means that work notes always need something added when performing an update, but that should be best practice anyway.

Be aware!  if you have followed this Servicenow article Disable the Post Comments button from disappearing in Activity stream (servicenow.com) and set the value field in  glide.activity.compose.can_post_mandatory_fields system property to true - the above ui policy will have no effect.

 

Annie M1
Tera Expert

I have a similar requirement and have seen the other post workaround but do not wish to make work notes mandatory in addition to the comments being mandatory when you click Start Work on an HR Case. Does anyone know how to hide the Post Comments button in HR Agent Workspace when I click Start Work? 

Colin10
Tera Contributor

Hi Annie,

As long as either the comments or work notes are set to mandatory in the ui policy, it will hide both post buttons. You don't need to have both set to mandatory. 

juliagelgor
Tera Contributor

Hello,

 

I created an idea regarding this topic, please vote for it if this functionality is still needed.

 

https://support.servicenow.com/ideas?id=view_idea&sysparm_idea_id=622ca0e8971486d0539e35d11153af27&s...

 

Best Regards,

 

Julia