- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2019 02:53 AM
I just wanted to populate the worknotes of an incident form to its related incident task form worknotes?
Can i expect a solution for this?
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2019 10:44 PM
Hi all,
Thank you for your response but i somehow got the solution for this problem.
After business rule :
condition: current.isValidRecord() &¤t.work_notes.changes()
script:
(function executeRule(current, previous /*null when async*/) {
updateRelatedIncidents();
function updateRelatedIncidents() {
var rec = new GlideRecord("problem_task");// Add the table name which needs to copy the work notes
rec.addActiveQueryry();
rec.addQuery("problem_id", current.sys_id);
rec.query();
while (rec.next()) {
rec .work_notes =current.work_notes.getJournalEntry(1);
rec .update();
}
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2019 10:17 AM
Hi Divya,
Write a BR script (after update) on the incident table and then add the below script in that Br.
if (current.work_notes != previous.work_notes) {
var gr = new GlideRecord("incident_task");
gr.addQuery("incident",current.sys_id);
gr.query();
if (gr.next()) {
gr.work_notes = current.work_notes;
gr.update();
}
}
Mark the comment as a correct answer and also helpful once worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2019 10:22 AM
Var notes = current.work_notes.getJournalEntry(1);
var gr = new GlideRecord("incident_task");
gr.addQuery("incident",current.sys_id);
gr.query();
while (gr.next()) {
gr.work_notes = notes;
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2019 10:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2019 10:44 PM
Hi all,
Thank you for your response but i somehow got the solution for this problem.
After business rule :
condition: current.isValidRecord() &¤t.work_notes.changes()
script:
(function executeRule(current, previous /*null when async*/) {
updateRelatedIncidents();
function updateRelatedIncidents() {
var rec = new GlideRecord("problem_task");// Add the table name which needs to copy the work notes
rec.addActiveQueryry();
rec.addQuery("problem_id", current.sys_id);
rec.query();
while (rec.next()) {
rec .work_notes =current.work_notes.getJournalEntry(1);
rec .update();
}
}
})(current, previous);