Incident form

Ram012
Tera Contributor

When I change the impact or urgency on an incident Record , I want the Assignment Group and Assigned To fields cleared out before
I save the record using incident table ?

 

I am using Business rule but code is not working.

 

Any idea above the scenaior help me.

2 REPLIES 2

HIROSHI SATOH
Mega Sage

This Business Rule will ensure that the "Assignment Group" and "Assigned To" fields are cleared whenever there’s a change in either the "Impact" or "Urgency" fields.

  1. Create a Business Rule:

    • Name: Clear Assignment Fields on Impact/Urgency Change
    • Table: Incident [incident]
    • When: Before
    • Update: Checked
    • Filter Condition: (current.impact.changes() || current.urgency.changes())
  2. Script:

     

 

(function executeRule(current, previous /*null when async*/) {
    // Clear Assignment Group and Assigned To fields if Impact or Urgency changes
    current.assignment_group = '';
    current.assigned_to = '';
})(current, previous);

 

 

Najmuddin Mohd
Mega Sage

Hi @Ram012 ,

If you want to see on the form clearing the values of Assignment group and Assigned to, when you change impact or urgency, then you can write an On Change client script on Priority (Since changing of impact / urgency changes priority).

 

NajmuddinMohd_0-1723882218650.png

 

Business rule will work when before/after you save the record, and clearing the values when any of the fields are mandatory at any particular stage may not be optimal solution.

 

Writing client scripts will clear the values and also makes sure to put in any other values if they are mandatory.


If priority matrix is not dependent, then write two client scripts. One on Impact and the other on Urgency.

If the above information helps you, kindly mark it as Helpful and Accept the solution.

Regards,
Najmuddin.