I want a business rule that copies work notes from a Problem Task to the associated Problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 09:31 PM
Hi,
Create a business rule that copies work notes from a Problem Task to the associated Problem whenever worknotes are added to the Problem Task.
Please help me out with the business rule.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 10:30 PM - edited 01-24-2025 10:31 PM
Hello @kranthi2
In Advanced section tab under script field add below code:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var problemRec = new GlideRecord('problem');
problemRec.addQuery('sys_id', current.problem);
problemRec.query();
if (problemRec.next()) {
problemRec.work_notes = current.work_notes.getJournalEntry(1);
problemRec.update();
}
})(current, previous);
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 02:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 08:03 AM