Conditional Logic for Incidents

sseverance
Giga Contributor

Hello community members! This may sound like a very simple question but I am new to ServiceNow development. How would I set up conditional logic for Incidents? Specifically, if the short description contains "Incident INC-1 opened" then assign it to a specific group. One of the challenges is the number will consistently increment by one every time a new Incident is created. Any help here is appreciated!

1 REPLY 1

Sujit Jadhav
Tera Guru

Hello @sseverance ,

1.Create a new Assignment Rule
Table: Incident

Condition:
Short description contains Incident INC-


OR


2.Business Rule
Table: Incident
When: Before
Insert: Checked

Script:
(function executeRule(current, previous) {

if (current.short_description &&
current.short_description.indexOf('Incident INC-') > -1) {

current.assignment_group = 'YOUR_GROUP_SYS_ID';
}

})(current, previous);



"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

Thank You,

Sujit Jadhav