Help me with the script to add a new variable field, into old opened sc-task form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 12:15 PM
this is the code to add the new varialble into RITM opened form already created before I added the new variable in the request form.
var query = " assignment_group.u_display_nameSTARTSWITHfive9^state=3"
var variable_sys_id = " Ca9798d3db540650f635a4fdd3961917"
var grRitm = new GlideRecord('sc_req_item');
grRitm.addEncodedQuery(query);
grRitm.query();
while(grRitm.next()) {
var newOpt = new GlideRecord('sc_item_option');
newOpt.initialize();
newOpt.value = "";
newOpt.item_option_new = variable_sys_id;
newOpt.order = 20;
newOpt.insert();
var mm = new GlideRecord('sc_item_option_mtom');
mm.initialize();
mm.request_item = grRitm.sys_id;
mm.sc_item_option = newOpt.sys_id;
mm.insert()
}
now i want to add the variable into sc_task. please help me with a script.