Updating variables values in a MRVS(sc_multi_row_question_answer) to sc_task table fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 05:40 PM
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2022 11:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2022 12:21 AM
Hi,
what debugging have you done?
did you check what came in logs for the MRVS json string?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader