Business Rule and Inbound Email Action

Geeky
Kilo Guru

Hi,

There is an inbound email action which creates Incidents with a priority as Medium. Now I am planning to write a business rule which will find a string in description and if that string in found set the priority to High. Business rule will be having attributes as Insert and Before.

Just wondering what will be value of Incident after I write this business rule?

1 ACCEPTED SOLUTION

i believe yes, it will be overridden by the business rule. Inbound email action is just trying to insert the new record but it's not defining when that action has to be performed, but before insert BR will trigger just before inserting the new record in database.  


View solution in original post

7 REPLIES 7

Vishal Khandve
Kilo Sage

hello srini,



You may try this one.


inbound action:




current.short_description =email.subject;


current.incident_state = IncidentState.NEW;


current.priority = 3;


current.insert();






Business Rule:


               


                    var inc = new GlideRecord("incident");


                    inc.initialize();


                    if(current.short_description == email.subject){


                    inc.urgency = '1'; // high


                    inc.impact = '1'; // high}


                    inc.update();


                       



Thank you.


I think I failed to explain in detail. As you mentioned above, I have both Inbound Email Action and a business rule for setting Priority. What will be the priority of the Incident when I am setting it from both (Inbound Email Action and Business Rule)? Will system override Priority set by Inbound Email Action with Business Rule?


i believe yes, it will be overridden by the business rule. Inbound email action is just trying to insert the new record but it's not defining when that action has to be performed, but before insert BR will trigger just before inserting the new record in database.  


Yes, you are right. I just tested it.