Healthcheck Button Visibility Logic Based on System Comments in General Case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2025 08:24 PM
Objective:*
we are working on implementing functionality that controls the visibility of a Healthcheck button in the General Case form in ServiceNow. The button's visibility is controlled based on comments added by "system."
*Detailed Breakdown:*
When should the Healthcheck button be hidden? The Healthcheck button should be hidden when a comment is added by system in the Additional Comments field of the General Case.
The button should remain hidden for 30 minutes after system adds a comment.
*_When should the Healthcheck button reappear?_*
After the 30-minute window has passed, the button should reappear and be visible again. If another system comment is added within that 30-minute window, the button should remain hidden for another 30 minutes from the time of the latest comment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2025 05:08 AM - edited 09-08-2025 05:09 AM
Hi @Hanook ,
You can achieve this by controlling the Healthcheck button visibility with a combination of a Business Rule (to track the latest system comment time) and a Client Script/UI Policy (to show or hide the button).
Here’s how you could approach it:
Business Rule (on Case Comments table):
Trigger when a comment is added by system in the Additional Comments field.
Update a field on the Case record (e.g., u_last_system_comment_time) with the timestamp of the system comment.
Client Script/UI Policy (on General Case form):
On form load, compare the current time with u_last_system_comment_time.
If less than 30 minutes have passed, hide the Healthcheck button.
If more than 30 minutes have passed, show the button.
If another system comment is added within 30 minutes, the Business Rule updates the timestamp, and the 30-minute window resets.
This way, the button automatically disappears for half an hour after a system comment and comes back when that time is up.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
