Business Rule Condition not working

m_m
Tera Contributor

The following condition works when the assignment group value selected from the assignment_group drop down list is 'Maintenace':

current.assignment_group.changes() && current.assignment_group.getDisplayValue() == 'Maintenance'

However, this condition does not work when the same 'Maintenance' value is autopopulated via an assignment rule

Further, this condition was used in replacement for my original condition (!current.assignment_group.nil() && current.assignment_group.changesTo(gs.getProperty('table.external_group'))) because I couldnt get that to work. The issue appears to be the use of the function changesTo().

Can anyone help please?

1 ACCEPTED SOLUTION

Check the order field on your business rule. There is some coordination between assignment rules and business rules you should be aware of.


Check section 1.2.1 here



http://wiki.servicenow.com/index.php?title=Defining_Assignment_Rules#Precedence_between_Assignment_R...


View solution in original post

19 REPLIES 19

It may be working because the middle part with the changes() check is being ignored. See the note on section 2.1 here



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



Note


Note: Asynchronous business rules do not have access to the previous version of a record. Therefore, these GlideElement methods do not work with async rules: changes(), changesTo(), changesFrom().

m_m
Tera Contributor

I see your point so really I should only be using?:



!current.assignment_group.nil() && current.assignment_group.getDisplayValue() == gs.getProperty('table.maintenance.external_group')


Why not change this to a before rule if you can't get rid of that condition ?


m_m
Tera Contributor

That takes me back to the original issue at the top of this chain - condition not working if the assignment group field value is auto-populated with an assignment rule. Works fine when manually selecting from drop down list.


Check the order field on your business rule. There is some coordination between assignment rules and business rules you should be aware of.


Check section 1.2.1 here



http://wiki.servicenow.com/index.php?title=Defining_Assignment_Rules#Precedence_between_Assignment_R...