How to add additional comments to Incidents when using a mass close UI action?

JordanDR
Tera Contributor

Hi there, 

I'm relatively new to scripting in ServiceNow and looking for some assistance. I'm trying to edit one of my UI actions that we use to mass close incidents so that it leaves the same additional comment on all of the incidents selected in the list. The code is the same as found in this sNow KB here. https://docs.servicenow.com/en-US/bundle/sandiego-it-service-management/page/product/incident-management/task/t_CreatingAUIAction.html

This is needed as we have a notification that triggers whenever a comment is added to an incident. Previous to this request, incidents were being close and the resolution note and resolve code were updated via the action, but the customer would not see any information as to why their incident was closed.

I'm assuming that I'd have to add something related to comments to the UI action/page and client script?

Any help would be appreciated!

 

1 REPLY 1

Jaspal Singh
Mega Patron
Mega Patron

If you want to copy same close notes to comments then you can simply add 

 incidentGr.setValue('comments', notes);

to the script include just before line

 incidentGr.update();