Automatically close Incident when Request is closed

Example business rule to automatically close the related (parent) Incident when a Request is closed.

Table: Request [sc_request]

When: After or Before

Update checkbox: True

Filter:

Parent.Task Type is Incident

Active change to False

(function executeRule(current, previous /*null when async*/ ) {

    var inc = current.parent.getRefRecord();
    if (inc.isValidRecord()) {
        inc.setValue('state', '6');
        inc.setValue('close_code', 'Resolved by request');
        inc.setValue('close_notes', 'Related Request is closed');
        inc.update();
    }

})(current, previous);

Something similar could also be created through flow designer.

Latest Posts