
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 11:55 AM
Hello,
I created an on display business rule that will set the Assignment group, Category and sub category for users in a specific department. I used filter conditions to look for the department and actions to set the field values, I didn't script this.
This works great, until one of those users needs to open an incident that should be assigned to another assignment group with a different Category and Sub category. I can't change the fields without the BR reverting them back when I update the incident. Is there a way to have it set the Assignment group, Category and Sub Category by default but then allow the user to change it before submitting the incident? This is also happening if one of the users in the aforementioned department Submits a record producer to create an incident. The Business rule overrides the RP settings.
The intention of the Business rule was to pre populate the fields as a convenience for the department when they submit incidents assigned to their department. The issue arises when they need to submit an IT incident that gets assigned to an IT group.
Is there a better way to do this?
Thank you,
Charles
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 08:15 AM
Sorry for the delay, thanks for posting the template strings. Here is your solution/edits to your existing business rule. Because we need to call the current.isNewRecord() API call, this requires that we make the business rule an "advanced" one and scripting is required. This is because we cannot check whether the record "is new record" in the filter conditions and we have to utilize the Condition script field instead.
- At the top of your business rule check the Advanced checkbox
- On the When to run tab:
- Uncheck insert and update
- Set When to display
- Click the X beside all of your conditions to remove all filter conditions. This tab should now look like this
- On the Actions tab, click the X beside all set field values to remove all of those settings. This tab should now look like this:
- On the Advanced tab:
- Set the Condition to the following:
-
current.isNewRecord() && ["5d9bd582db21ff40b2b77b668c961929", "aee387e8db720b003d3d7d568c961949","11bde863db4aeb40918dff971d961996"].indexOf(current.opened_by.department.toString()) > -1
- Then paste in the following script:
(function executeRule(current, previous /*null when async*/) {
/*
* This business rule runs only on a new incident when the Opened By User's Department is:
* Business Intelligence, Business Application Support (cannot see entire name), or Business Application Support (cannot see entire name)
*/
current.assignment_group = "773a332ddb281f405cbf7d598c9619fe"; //SN_BusinessIntelligence
current.category = "reports";
current.contact_type = "self-service";
})(current, previous);
That should do it! Since this business rule now runs only on display, your record producers, integrations, etc that create/update incidents in the background won't be affected. And because the condition contains current.isNewRecord() this will only fire when the user clicks New incident versus firing on existing incidents.
Please mark this post or any as helpful or the correct answer if applicable so others viewing may benefit.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 08:31 AM
That is perfect. Thank you for your detail and walking me through the thinking!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 02:20 PM
You are very welcome!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2022 06:52 AM
To identify the business rules and flows that run on a record when inserting, updating, deleting, displaying or querying the record the DevTools' WhatRuns button comes in handy.
As the name suggests it shows you what runs on a record (including business rules on parent tables).
DevTools contains a truckload of re-usable functions and features for developers.
Fork at will: