How to map catalog form variable (Group table) to SC task Assignment group field using business rule

raj99918
Tera Contributor

Hi 

 

How to map catalog form variable (Group table data type refernce) to SC task Assignment group field using business rule ?

 

BR rules: Before insert

 

I tried this one (current.assignment_group = current.variables.group.sys_id) But no luck and BR is triggering but by the logs I found that current.variables.group.sys_id is giving the undefined value any reason for this one ?

 

Thanks

3 REPLIES 3

Eshwar Reddy
Kilo Sage

Hi @raj99918 

Try

current.assignment_group = current.variables.group

Thanks 
Esh

Bhavya11
Kilo Patron

Hi @raj99918 ,

 

if your using the flow or this catalog you can data pill information easily.

Bhavya11_0-1728636996841.png

 

can you try below script after insert

 var gr = new GlideRecord('sc_req_item');
    gr.addQuery('sys_id', current.request_item);
    gr.query();
    if (gr.next()) {
        // Retrieve the catalog variable value (replace 'u_assignment_group_var' with your variable name)
        var assignmentGroup = gr.variables.group_name;

        // If the variable has a value, set it in the Assignment Group field
        if (assignmentGroup) {
            current.assignment_group = assignmentGroup;
           current.update();
        }
 
 
Thanks,
BK

Brad Bowman
Kilo Patron
Kilo Patron

If the variable is not included in the task, or due to timing, you can get it from the RITM record

current.assignment_group=current.request_item.variables.group;

or 'parent' in place of 'request_item' if that field is populated with the RITM instead on your sc_task records.