- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2025 12:35 AM
Currently, when a requester submits a request through the ServiceNow portal, they receive a 'Request' number for tracking updates. However, fulfillers can only provide updates on Service Catalog Tasks (Sc_tasks).
Unfortunately, neither requesters nor fulfillers are receiving regular conversation updates.
I tried with below BR . It is not working as expected .
Table : Sc_task
When to run: after
Update is checked
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2025 02:30 AM
Hi @JP6
Please try the below approach. It'll work.
1. Create one event registry.
Name: Update commnts in RITM
Table: Task [task]
2. Create one business rule on Task table as below.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var task_cmnts = current.comments.getJournalEntry(1).split("(Additional comments)\n")[1];
if (current.getTableName() == 'sc_req_item') {
gs.eventQueue('update.cmts.task', current, task_cmnts, current.sys_id); // Trigger the event by passing the latest comments and task sys_id (RITM sys id)
}
if (current.getTableName() == 'sc_task') {
gs.eventQueue('update.cmts.task', current, task_cmnts, current.request_item.sys_id); // Trigger the event by passing the latest comments and task sys_id (RITM sys id)
}
})(current, previous);
3. Script action: (Async function to make updates as system)
var task_cmnts = event.parm1;
var task_sys_id = event.parm2;
//SET commnets from RITM to all the active SC Tasks
if (current.getTableName() == 'sc_req_item') {
var sc_task = new GlideRecord('sc_task');
sc_task.addQuery('request_item', task_sys_id);
sc_task.query();
while (sc_task.next()) {
sc_task['comments'].setJournalEntry(task_cmnts, current.sys_updated_by);
sc_task.update();
}
}
//SET commnets from SC Task to RITM
if (current.getTableName() == 'sc_task') {
var ritm = new GlideRecord('sc_req_item');
ritm.get(task_sys_id);
ritm['comments'].setJournalEntry(task_cmnts, current.sys_updated_by);
ritm.update();
}
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2025 02:30 AM
Hi @JP6
Please try the below approach. It'll work.
1. Create one event registry.
Name: Update commnts in RITM
Table: Task [task]
2. Create one business rule on Task table as below.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var task_cmnts = current.comments.getJournalEntry(1).split("(Additional comments)\n")[1];
if (current.getTableName() == 'sc_req_item') {
gs.eventQueue('update.cmts.task', current, task_cmnts, current.sys_id); // Trigger the event by passing the latest comments and task sys_id (RITM sys id)
}
if (current.getTableName() == 'sc_task') {
gs.eventQueue('update.cmts.task', current, task_cmnts, current.request_item.sys_id); // Trigger the event by passing the latest comments and task sys_id (RITM sys id)
}
})(current, previous);
3. Script action: (Async function to make updates as system)
var task_cmnts = event.parm1;
var task_sys_id = event.parm2;
//SET commnets from RITM to all the active SC Tasks
if (current.getTableName() == 'sc_req_item') {
var sc_task = new GlideRecord('sc_task');
sc_task.addQuery('request_item', task_sys_id);
sc_task.query();
while (sc_task.next()) {
sc_task['comments'].setJournalEntry(task_cmnts, current.sys_updated_by);
sc_task.update();
}
}
//SET commnets from SC Task to RITM
if (current.getTableName() == 'sc_task') {
var ritm = new GlideRecord('sc_req_item');
ritm.get(task_sys_id);
ritm['comments'].setJournalEntry(task_cmnts, current.sys_updated_by);
ritm.update();
}
Regards,
Siva