How to get the sys_id of the system, user_name = system?

coryreidmiller
Tera Contributor

Hello,

We are trying to stop notifications from firing when the "system" adds a comment.

We added a condition to the notification and want to do some testing.

How can we make it look like the "system" is making the entries?

Here is where we are so far:

 

var gr = new GlideRecord('sc_task');
//Get a test sc task
  gr.get(c5cd7ba91b110210f30db8cc1d4bcbe5);
//Add a comment (comment text, sys_id of user making comment)
  gr.comments.setJournalEntry(test, '6816f79cc0a8016401c5a33be04be441')
//Save it
  gr.update();
 
Any ideas/help is greatly appreciated, thank you!
5 REPLIES 5

Amit Pandey
Kilo Sage

Hi @coryreidmiller 

 

I would recommend you to use background script for this purpose with setWorkflow(false);

 

Regards,

Amit