Business Rule to update Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 02:12 AM
Hi Team,
Please assist.
We want to update 1) Priority of Incident based on combination of two fields cmdb_ci.attribute and impact in Incident
example : if Impact = High and cmdb_ci.attibute = 1, THEN Incident priority =P1
likewise there are 4 combinations
also i started with another piece to be added here
if cmdb_ci.support_group is NOT empty, then populate the Incident-Assignemnt group = cmdb_ci.support_group
Can someone please assist
THanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 02:28 AM
@Nisha30 you can create a BR to run in insert or update with follow simple script:
if (current.impact == 'High' && current.cmdb_ci.attribute == 1) {
current.priority = 1;
} else if (current.impact == 'High' && current.cmdb_ci.attribute == 2) {
current.priority = 2;
} else if (current.impact == 'Medium' && current.cmdb_ci.attribute == 1) {
current.priority = 3;
} else if (current.impact == 'Medium' && current.cmdb_ci.attribute == 2) {
current.priority = 4;
}
if (!gs.nil(current.cmdb_ci.support_group)) {
current.assignment_group = current.cmdb_ci.support_group;
}
Hope this will help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 02:41 AM
Hello Nisha,
Add your conditions in 'else if' and test
if (current.impact == 'high' && current.cmdb_ci.attribute == 1) {
current.priority = 1;
} else if (condition 2) {
current.priority = 2;
} else if (condition 3) {
current.priority = 3;
} else if (condition 4) {
current.priority = 4;
}
else{
//nothing
}
if (!gs.nil(current.cmdb_ci.support_group)) {
current.assignment_group = current.cmdb_ci.support_group;
}
Please mark my solution as helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 06:19 AM
Hi @Abhay Kumar1 ,
Below is my code but it is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 03:42 AM
Hi @Nisha30 ,
In ServiceNow, the Incident Table Priority is determined through Priority Lookup Rules, so you need to review and configure these rules accordingly.
As for your second requirement, there is already an Out-of-the-Box (OOB) Business Rule available that updates the Assignment Group based on the CMDB_CI.support_group.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you found my response **helpful**, I’d appreciate it if you could take a moment to select **"Accept as Solution"** and **"Helpful"** Your support not only benefits me but also enriches the community.
Thank you!
Moin Kazi
www.linkedin.com/in/moinuddinkazi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~