
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 09:16 AM
Good morning,
I have been tasked with putting the incident comments and work notes onto the incident task notification email. I found a script that I believe can be modified for the task, but I thought I'd see if there was a better solution out there in the community before I committed to this path.
Thank you in advance!
Tyler
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 09:28 AM
I would just reference via the available variables in the notification set up on the What it will contain tab - open variables, hit the + next to incident, then select Comments and work notes - this will automatically put it into the notification.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 09:21 AM
Hi,
Please tell me one thing. Do you want to update it on incident form or notification on that incident form.
Also when is that incident task notification triggered.
Thanks,
Ashutosh Munot

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 09:25 AM
Ideally, it'd update when I create the task. Right now, our frontline support owns incidents and tasks our upstream teams with tasks; the upstreams would like to see what's come before when they get the incident_task notification.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 09:23 AM
You could use something like this:
var journalString = "";
var actObject = new GlideRecord('sys_journal_field');
actObject.addQuery('element_id', <incident.sys_id>);
actObject.query();
journalString = '';
while( actObject.next() ) {
journalString += actObject.sys_created_on + ' - ' +
actObject.sys_created_by + ' (' + actObject.element + ')\n' +
actObject.value + '\n\n';
}
The output of 'journalString' would contain all comments and worknotes currently belonging to the Incident.
Obviously, you'd need to modify this a bit to fit your needs.
Hope that helps!
Tim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2018 09:26 AM
Tim, this looks great. Thank you!