Updating variables values in a MRVS(sc_multi_row_question_answer) to sc_task table fields

Samarendra Naya
Kilo Contributor

Hello All,

I have a requirement of updating  all my variables values in a MRVS(sc_multi_row_question_answer) for a particular catalog item to sc_task table fields and i am trying with business rules as below which is not working.

 

Condition : current.variables.changes() && current.request_item.cat_item.name == 'Demand Management Request'

(function executeRule(current, previous /*null when async*/) {


var gr = new GlideRecord('sc_multi_row_question_answer');
gr.addQuery('parent_id',current.request_item);
gr.query();
while (gr.next()) {
gr.variable.u_actual_build_end_date = current.variable.buid_end_date;
gr.u_applicable_geo = current.variables.applicable_geo;
gr.u_applicable_org_entity = current.variables.applicable_org_entity;
gr.u_applications = current.variables.applications;
gr.u_benefits_of_change = current.variables.benefits_of_change;
gr.u_estimated_saving_hours = current.variables.estimated_saving_hours_per_annum;
gr.u_function = current.variables.function;
gr.u_function_delivery_group = current.variables.function_delivery_group;
gr.u_module = current.variables.module;
gr.u_demand_priority = current.variables.Priority_demand;
gr.u_proposed_change = current.variables.proposed_change;
gr.u_reason_for_change = current.variables.reason_for_change;
gr.u_request_description = current.variables.request_description;
gr.u_request_title = current.variables.request_title;
gr.u_demand_request_type = current.variables.request_type;

}


})(current, previous);

 

Please suggest.

 

Thanks,

Nayak

11 REPLIES 11

Hi Ankur,

Thank you!!

I have tried but not getting the value updated in the sc_task table.

 

Please check attached screen and suggest.

Thanks,

Samarendra Nayak

Hi,

what debugging have you done?

did you check what came in logs for the MRVS json string?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader