How to input Order Guide variable data into REQ/RITM/SCTASK attribute field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 12:15 PM
Hello Community,
Any assistance would be appreciated. I need to post data coming from variables fields from an Order Guide, to an attribute on the REQ/RITM/SCTASK record form.
The variables are "hardware_delivery_date" or "hardware_delivery_date_urgent".
The attribute is "u_hardware_delivery_due_date".
Workflow:
Script A:
var gr = new GlideRecord('sc_request');
if (gr.get(current.request)) {
gr.short_description = "Hardware Request for " + current.variables.requested_for.getDisplayValue();
gr.assignment_group = current.assignment_group;
gr.location = current.variables.requested_for.location;
current.u_hardware_delivery_due_date = current.variables.hardware_delivery_date;
gr.update();
}
Script B:
task.short_description = "Hardware Request for " + current.variables.requested_for.getDisplayValue();
task.description = current.quantity.getDisplayValue() + " - " + current.cat_item.short_description.getDisplayValue();
task.u_order_number = current.variables.ornumber;
task.u_po_number = current.variables.ponumber;
task.location = current.variables.location;
task.u_hardware_delivery_due_date = current.variables.hardware_delivery_date;
//Set assignment group
if (current.variables.location != "") {
var group = new GlideRecord('sys_user_group');
group.addQuery('u_location', current.variables.location);
group.query();
if (group.next()) {
task.assignment_group = group.sys_id;
}
} else {
task.assignment_group = "Solution Center"; // solution center group
task.short_description = current.cat_item.getDisplayValue() + " for " + current.variables.requested_for.getDIsplayValue();
}
Order Guide:
Variables:
Attribute: