Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 04:26 PM
Hi Nayan,
Thanks for your quick response.
I tried that condition and below script . Unfortunately, it didn't copy the transcript to the Incident.. Before it was getting copied twice.
(function executeRule(current, previous /*null when async*/ ) {
var query = "document_table=incident^interaction.number=" + current.number;
var irc = new GlideRecord("interaction_related_record");
irc.addEncodedQuery(query);
irc.query();
if (irc.next()) {
var inc = new GlideRecord("incident");
if (inc.get(irc.task.sys_id)) {
inc.comments = current.transcript + "";
inc.update();
}
}
// var inc = new GlideRecord('interaction_related_record');
// inc.addQuery('interaction', current.sys_id);
// inc.addQuery('document_table', 'incident');
// inc.addQuery('type', 'task');
// inc.query();
// while (inc.next()) {
// gs.addInfoMessage("test");
// var incident = new GlideRecord('incident');
// incident.addQuery('sys_id', inc.document_id);
// incident.query();
// while (incident.next()) {
// //incident.comments = current.transcript;
// incident.comments = current.internal_transcript.toString();
// incident.update();
// }
// }
})(current, previous);