SCTask
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2023 09:38 AM
Hello team when adding a close comment to SCTask it show as created by Sytem rather than user creating the comment
7 REPLIES 7

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2023 11:55 AM
Ah, that is what your looking for 🙂
Use it like this:
(function executeRule(current, previous /*null when async*/) {
var item = new GlideRecord('sc_req_item');
item.get(current.request_item);
item.comments.setJournalEntry(current.comments.getJournalEntry(1),gs.getUserName()); //Get last journal entry
item.update();
})(current, previous);
If needed, you could set a different user_name instead of gs.getUserName()
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2023 07:26 AM
@Peter Bodelier didn't work still showing as System

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2023 11:52 PM
Ok, then for some reason your BR is triggered by a system update.
Try
(function executeRule(current, previous /*null when async*/) {
var item = new GlideRecord('sc_req_item');
item.get(current.request_item);
item.comments.setJournalEntry(current.comments.getJournalEntry(1),current.sys_updated_by); //Get last journal entry
item.update();
})(current, previous);
Or maybe even
(function executeRule(current, previous /*null when async*/) {
var item = new GlideRecord('sc_req_item');
item.get(current.request_item);
item.comments.setJournalEntry(current.comments.getJournalEntry(1),previous.sys_updated_by); //Get last journal entry
item.update();
})(current, previous);
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.