How to update additional comments as comments in case form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 08:49 PM
Hi,
create a new case from the Customer Service > case > Create New.
After creating new case, we can create a incident from a case.
After Incident is created, when we update any comments in incident form, in case Activity stream it will update as a Work Note.
However, We need to update that comment in case as a Additional Comments.
we have tried to updating OOTB script, however script include is on protection policy.
How to achieve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 10:05 PM
Hello,
To update additional comments as comments in a case form from an incident form in ServiceNow, you'll need to create a custom business rule or script to handle this functionality. Since the Out-of-the-Box (OOTB) script include is protected and cannot be modified, creating a custom solution is the way to go. Here’s how you can achieve this:
Steps to Update Comments from Incident to Case
-
Create a Business Rule on the Incident Table:
- Go to System Definition > Business Rules.
- Click New to create a new business rule.
-
Configure the Business Rule:
- Name: Provide a name, e.g.,
Update Case Comments from Incident
. - Table: Select
Incident [incident]
. - When: Choose
after
. - Insert: Ensure this is checked (as we want this to trigger after an incident is updated).
- Update: Ensure this is checked (as we want this to trigger after an incident is updated).
- Name: Provide a name, e.g.,
-
Condition:
- You can set a condition to check if comments were updated, e.g.,
current.comments.changes()
.
- You can set a condition to check if comments were updated, e.g.,
-
Script:
- In the Advanced tab, write a script to update the additional comments in the related case.
Here’s an example script that can be used in the business rule:
(function executeRule(current, previous /*null when async*/) {
// Check if the incident has a related case
if (current.u_case) {
// Get the related case record
var caseGR = new GlideRecord('sn_customerservice_case');
if (caseGR.get(current.u_case)) {
// Append the incident comments to the case's additional comments
caseGR.comments = current.comments.getJournalEntry(1); // Get the latest comment
caseGR.update();
}
}
})(current, previous);
Regards,
Vaishnavi Lathkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 11:17 PM
I have updated the code,
In case still it is updating as a worknotes, not as a comments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 10:13 PM
comments are for end users and work notes are for agents
did you try to have your custom logic?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader