Incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 10:49 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2024 11:33 PM
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.
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())
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2024 01:13 AM - edited 08-17-2024 01:17 AM
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).
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.