How to post comments as system instead of current user in scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Team,
I am trying to post comments via script in scoped application but in the activity stream it is showing as Logged in User i wanted to show it as system i cant use setJournalEntry() method in scoped application script How to achieve this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you can create a workflow on that table in your scoped app and give Wait for Duration with 2-3 seconds
Once that Wait for Duration is done you can use script to set comments and it will come as System user
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Ankur, I have added the wait duration in Flow and the flow is running as System
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you can try to use custom flow action and use script step to create record into sys_journal_field and set the sys_created_by = System
OR
please use workflow and use approach I mentioned of timer
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
This is going to depend on the nature of the script you are running.
If you are running a client side script then I don't believe there is a way to perform the action as the System user. I think you would have to create an event caller to queue an event to trigger a server side script/flow that you could set to run as/by the system user.
If you are in a workflow action or server side script (not a script include) then you should have the option to set it to run as system.