- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2014 08:27 PM
Hi All,
I have written a business rule to set the auto assignment group for Catalog Item.
But it is not workin....
Please help.
My requirement is, there is a choice field "Choose Role" which has some 30 values in my Catalog item.
If I select A or F or M for Choose Role, request item should assign to XYZ group, else should assigne to ABC group.
Below is my script.
var gr=new GlideRecord("sc_req_item");
gr.addQuery("sys_id", current.sys_id);
gr.query();
if(gr.next()){
CatItem = gr.cat_item.getDisplayValue();
//gs.addInfoMessage(CatItem);
if (CatItem =='Demo')
{
var RoleType = current.variables.chooserole_vce1.getDisplayValue();
//gs.addInfoMessage(RoleType);
var grpname;
if (RoleType == 'A' || RoleType == 'F' || RoleType == 'M')
{
//gr.setValue('assignment_group', 'SEC Adm VCE VMS');
grpname = 'XYZ';
//gs.addInfoMessage(current.assignment_group.name);
}
else
{
grpname = 'ABC';
}
}
Please help, its urgent
Thanks in advance.
Thanks,
Madan
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2014 12:01 AM
try this ...
condition : current.cat_item.sys_id == 'sys id of your catalog'
script:
var RoleType = current.variables.chooserole_vce1.getDisplayValue();
if (RoleType == 'A' || RoleType == 'F' || RoleType == 'M')
{
current.assignment_group.setDisplayValue('XYZ');
}
else
{
current.assignment_group.setDisplayValue('ABC');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2014 03:55 AM
Hi,
For improving your solution, I recommend you to check "System Policy" --> "Rules" --> "Assignment" module. (at [sysrule_assignment] table)
I think this is the right place to do this.
I hope it will help you.
Best Regards