Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Query on Business rule wrt Assignemnt group and Assigned to fields?

Suggy
Giga Sage

In user table I have an user called'UserA'

In group table I have a group called 'GroupA'

 

In my business rule, i have written below 2 lines of code..

 

current.assigned_to =  "UserA"; -----> THIS WORKS

current.assignment_group = "GroupA"; ------> This DOES not work... WHY? (if I pass the sys_id, only then it works).

 

Why? both are reference fields. Then why the difference?

5 REPLIES 5

_Gaurav
Kilo Sage

Hi @Suggy 
Need to look at the configuration of the tables and others, but SN best practice says always use the sys_id while working with the reference fields as the name can be changed.
Thanks!

Yes @_Gaurav  I know that its best practice to use sys_id, but still wanted to know the reason for above behaviour 🙂

Hugo Barros
Tera Contributor

hi @Suggy , maybe it can be something with the fields attributes. Could you check if both have the same value?

Hello @Hugo Barros  I already checked it, that did not make any difference.