How to post comments on associated inc from prb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 11:37 AM
Hello,
We have incidents that are associated with problem tickets that are not being updated with information when comments are added to the problem. Is there a way to add the comments from the problem into the incidents?
Thank you,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 12:00 PM
Hi @achen ,
Create business rule on problem table with update check box enabled with required condition. And query incident table in script with the associated incident. Add below line in script:
current.comments.setJournalEntry('Resolution:\n' + current.close_notes);
Plz mark my solution as Accept, If you find it helpful.
Thanks & Regards,
Sumanth meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 12:47 PM
Hi @achen ,
Create 'async' business rule as below:
In the Advanced section, paste the below:
(function executeRule(current, previous /*null when async*/ ) {
updatePrbRelatedInc();
function updatePrbRelatedInc() {
var incRec = new GlideRecord("incident");
incRec.addQuery("problem_id", current.sys_id);
incRec.query();
while (incRec.next()) {
incRec.comments = current.comments.getJournalEntry(1);
incRec.update();
}
}
})(current, previous);
Result:
2 incidents are attached to PRB
Updated the customer update in PRB:
Linked Incidents are also showing the same update:
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.