Duplicate work note entries in the Incident form (Business rule script). Kindly asking to help me

Veteran
Tera Contributor

Hi all,
Just wondering if someone is able to help understand this script within business rule please
Thank you 

(function executeRule(current, previous /*null when async*/) {
    // Add your code here
    if(current.reassignment_count == 2){
        current.work_notes = 'Incident reassigned - Escalated \nDate: ' + current.sys_updated_on + '\nReassigned by: ' + gs.getUserDisplayName() + '\nPrevious Assignment Team: ' + previous.assignment_group.getDisplayValue() + '\nCurrent Assignment Team: ' + current.assignment_group.getDisplayValue();
    } else {
            current.work_notes = 'Incident reassigned \nDate: ' + current.sys_updated_on + '\nReassigned by: ' + gs.getUserDisplayName() + '\nPrevious Assignment Team: ' + previous.assignment_group.getDisplayValue() + '\nCurrent Assignment Team: ' + current.assignment_group.getDisplayValue();
    }
})(current, previous);
Alex Cripps
1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron

@Veteran This business rule checks of the reassignment count for the current record is equal to 2 if the condition evaluates to true then it prepares a work note with Escalated word added to Incident reassigned string. The worknote is essentially the same in both the cases, condition was checked to just add Escalated word for those records where is reassignment count is equal to 2. 

View solution in original post

10 REPLIES 10

@Veteran Looks like there are multiple BRs on your instance which are adding these worknotes. 

@Sandeep Rajput  Most probably yes, thank you 😊

Alex Cripps

@Veteran Please don't forget to mark the response accepted solution if you find the another BR responsible for adding the duplicate worknotes.

Veteran
Tera Contributor

Just de-activated the BR and still experiencing duplicate work note entries

Alex Cripps

@Veteran Looks like there are other business rule adding the worknotes. Please looks for those business rules and deactivate them.