- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
As SCTASK table is not visible to end user, emails cannot be triggered from there to them and our customer do not like to move between SCTASK and RITM table in order to interact with end user. So we thought of mapping the SCTASK table additional comments on RITM table additional moments so that email can be triggered to end user or task assigned to accordingly. How to achieve this functionality.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @akchauhan ,
Try this:
Table: sc_task
When: after
Condition: Comments changes
Insert: true
Update: true
// Get the latest comment from the task
var latestComment = current.comments.getJournalEntry(1); // 1 = most recent pass 1 in parenthesis
// Get the associated Request Item (RITM)
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(current.request_item)) {
// Add the comment to the RITM's Additional Comments
ritmGR.comments = "Comments added on task :" + current.number + "\n" + latestComment;
ritmGR.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @akchauhan ,
Refer the below thread:
Solved: Copy comments from RITM to Task & vice versa. - ServiceNow Community
If this solves your query, mark this as correct/helpful.
Thanks
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello Anand,
Solution is not working. If you can assist in any way, Please assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @akchauhan ,
Try this:
Table: sc_task
When: after
Condition: Comments changes
Insert: true
Update: true
// Get the latest comment from the task
var latestComment = current.comments.getJournalEntry(1); // 1 = most recent pass 1 in parenthesis
// Get the associated Request Item (RITM)
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(current.request_item)) {
// Add the comment to the RITM's Additional Comments
ritmGR.comments = "Comments added on task :" + current.number + "\n" + latestComment;
ritmGR.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Dear Anand,
Many thanks for such quick support on my query. I am able to see the mapping between SCTASK and RITM table and comments are copying. Many many thanks for your support.
