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

Business Rule - Add automatic comments as admin

SNOW User8
Giga Guru

Hi All,

Want to add automatic comments in an incident additional comments field when new incident is inserted.

My issue is, added comments are updated by the current user, But I want it as Admin. Since it is an automatic comments.

How to do that ?

If anyone know the solution kindly, help me.

Business Rule:

Before insert,

Script:

(function executeRule(current, previous /*null when async*/) {

// Add your code here

current.comments = "Thank you for contacting TEST";

})(current, previous);

The comments here added by the current user, I want it as System Administrator

find_real_file.png

Thanks & Regards,

Anna Silva

24 REPLIES 24

Can you attach screenshots?



It shouldn't work on an after rule! Only before!



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Paul Morris



Please find the attachments,


find_real_file.png


find_real_file.png


Can you show your 'before' business rule?



If this is working for you anyway, please mark my answer as correct



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Paul Morris



But I want the solution to work before insert condition.


I can't really help further until I can see your 'before' business rule.


All you should need to do is substitute my line of code in with the business rule in your first post.



I just did this in a test environment (our admin account is called 'Kinetic IT')


find_real_file.png




find_real_file.png


find_real_file.png



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022