- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 01:25 AM
Hi all,
We use interactions and when we associate an interaction to an incident for example is it possible to get a work note into the ticket it has been linked to saying IMS...... has been linked?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 02:05 AM - edited 04-24-2025 02:32 AM
Hi @joshmorris
Yes. It's possible.
Create one After Business rule on interaction_related_record table like below.
(function executeRule(current, previous /*null when async*/) {
var task_rec = new GlideRecord('task');
task_rec.get(current.task.sys_id);
task_rec.work_notes = current.task.getRefRecord().number +' has been associated with '+current.interaction.getRefRecord().number;
task_rec.update();
})(current, previous);
Hope this helps.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 02:44 AM
you can use flow designer for this with no scripting
Flow Triggers when Insert on "interaction_related_record" and updates the INC
something like this but please enhance
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 04:17 AM
@joshmorris Yes, you can. PFB script and make changes as required.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var task_rec = new GlideRecord('task');
task_rec.get(current.task.sys_id);
task_rec.work_notes = current.task.getRefRecord().number +' has been associated with '+current.interaction.getRefRecord().number+'\n'+'Short description: '+current.interaction.getRefRecord().short_description;
task_rec.update();
})(current, previous);
Output:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 02:05 AM - edited 04-24-2025 02:32 AM
Hi @joshmorris
Yes. It's possible.
Create one After Business rule on interaction_related_record table like below.
(function executeRule(current, previous /*null when async*/) {
var task_rec = new GlideRecord('task');
task_rec.get(current.task.sys_id);
task_rec.work_notes = current.task.getRefRecord().number +' has been associated with '+current.interaction.getRefRecord().number;
task_rec.update();
})(current, previous);
Hope this helps.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 04:04 AM
This worked thank you, is it possible to tweak the script so the work note says that its been linked like it does now but then on another line it pulls through the description of the interaction?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 04:17 AM
@joshmorris Yes, you can. PFB script and make changes as required.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var task_rec = new GlideRecord('task');
task_rec.get(current.task.sys_id);
task_rec.work_notes = current.task.getRefRecord().number +' has been associated with '+current.interaction.getRefRecord().number+'\n'+'Short description: '+current.interaction.getRefRecord().short_description;
task_rec.update();
})(current, previous);
Output:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 04:41 AM
Thank you