How to get the sys_id of the system, user_name = system?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 08:41 AM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 02:30 AM
I would recommend you to use background script for this purpose with setWorkflow(false);
Regards,
Amit