- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 02:07 PM
Hello ,
i need to write a business rue script to set up a priority on incident table.When business service is
'Email' set up urgency and
impact to 1 and when is 'Bond Trading' set up impact and urgency to 2. What the script will look like?
Should i choose before business rule on insert or update?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2019 02:12 PM
Hello,
Please have a look at the following thread:
Suggestion Required: Incident Priority Lookup based on "CI" criticality and "Urgency" values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 02:57 AM
Is there any way to do it via before Business Rule script??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 03:06 AM
Condition should be
and script should be
(function executeRule(current, previous /*null when async*/) {
if(current.business_service.changesTo('27d32778c0a8000b00db970eeaa60f16')) //email
{
current.impact=1;
current.urgency=1;
}
else//Bond Trading
{
current.impact=2;
current.urgency=2;
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 03:03 AM
Here is the sample BR script
if(current.cmdb_ci.name == 'NAME_OF_BUSINESS_SERVICE'){
current.impact = 1;
current.urgency = 1;
}
else if(current.cmdb_ci.name == 'NAME_OF_BUSINESS_SERVICE'){
current.impact = 2;
current.urgency = 2;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 04:02 AM
Hello,
You can do with before business rule by using below code: Take Incident table with insert or update as per your requirement.
(function executeRule(current, previous /*null when async*/) {
if(current.business_service.name == 'Email'){
current.impact = 1;
current.urgency = 1;
}
else if(current.business_service.name == 'Bond Trading'){
current.impact = 2;
current.urgency = 2;
}
})(current, previous);
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 04:32 AM