Precedence b/w Assignment Rules vs DISPLAY Business rule ?

Vijay Talupula
Tera Guru
Tera Guru

Guys,

I am aware the precedence b/w assignment rules and business rules as mentioned below,

http://wiki.servicenow.com/index.php?title=Defining_Assignment_Rules#gsc.tab=0

1.2.1 Precedence between Assignment Rules and Business Rules

When creating new assignment rules, keep in mind that business rules can take precedence over assignment rules in certain circumstances. Assignment rules and business rules run in the following order:

  1. All before business rules that run on a record insert with an order value less than 1000.
  2. The first assignment rule with the lowest execution order and matching condition.
  3. All before business rules that run on a record insert with an order value greater than or equal to 1000.
  4. All after business rules that run on record insert.

BUT how the assignment rules behaves when there is a DISPLAY business rule on the same table the rules configured ? any suggestions would be appreciated.

Actually, as per our requirement, the default assignment group for new incidents should be "Service Desk" unless otherwise creator has to change it, so we have chosen DISPLAY business rule without considering (keeping in mind) the existing assignment rules.

Now we have found that because of this DISPLAY business rule, the assignment rules are not working. I have also changed the business rule order to higher value 1001 (from 100) than the assignment rules order (100).

Any suggestion on this how to proceed ?

6 REPLIES 6

Chuck Tomasi
Tera Patron

Hi Vijay,



Display business rules run right after the record is read and just before it is sent to the browser. They are typically used to set values in g_scratchpad to be consumed by an onLoad client script. Changing the order of the display BR will only affect what order it is loaded in relationship to other display BRs.



BRs that react to insert/update operations run when the form is saved/submitted (either before the commit or after the commit.)



Based on what you said, I don't think the display BR is going to do you what you expect in this case.



Reference:


Business Rules Best Practices - ServiceNow Wiki  


Thanks Chuck for the info.



What would be your thoughts to achieve this without overriding/breaking the assignment rules functionality ?


Hi Vijay,



I'm not Chuck ( he's a great guy btw... Hi Chuck ), still here goes some thoughts:



a) it appears that your display business rule may be a little bit restricted. is it the OOB incident query one?


b) does your users have the itil role or met the criteria according to the OOB incident query display business rule? (Has ITIL or is the Caller or Is the person that opened the incident or Is in the watch list)


if (!gs.hasRole("itil") && gs.isInteractive()) {


  var u = gs.getUserID();


  var qc = current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u);


  gs.print("query restricted to user: " + u);


}


c) ultimately, you may want to consider relying only or mostly in ACLs and not in the display business rules or relaxing it a little bit so that your assignment rules can still be executed.



Thanks,


Berny


Hi Chuck and Berny,



I am able to overcome the issue which I have posted. I have enabled the flag "Replace Always" from the module as mentioned in the below screenshot, so that the datalookup rules works for form updates (i.e. replacing the existing assignment group value in this case).



For more details on this, please refer to the wiki link and navigate to the section : 2.3.3 Setter Field Definitions Fields.



System Policy > Rules > Data Lookup Definitions > Assignment Lookup > Setter Field Definitions > assignment_group



find_real_file.png