Unable to map the ticket sys id as the parent of request submitted from the ticket via ui action

AARTHI
Tera Contributor
UI Action : Create request should redirect to a particular catalog item and after submission of the request it should map the sysid of the ticket from which the UI Action was triggered as the parent of the request submitted. 
Below is the script am using in UI Action but no luck. Can anyone help in fixing this?

UI Action :

new x_usbna_cf_csm.CF_Hide_Buttons().createRequest(current,action);

 

Script include:

createRequest: function(current, action) {

current.update(); var url = "mytech?id=sc_cat_item&sys_id=6565043adb5f37c065d98fd3399619bf&sysparm_parent_table=" + current.sys_class_name + "&sysparm_parent_sys_id=" + current.sys_id;

action.setRedirectURL(url);

},

5 REPLIES 5

Brad Bowman
Kilo Patron
Kilo Patron

Is anything happening - redirecting to the correct Catalog Item?

Yes it is redirecting to catalog item, that part is fine. But I want that submitted request to be tagged under my ticket ie the parent of the request should be the ticket number from where this UI Action initiated. That part is not happening

Check to confirm that this UI Action is populating the Parent field on the first record that is created - the REQ.  If so, then you just need a before Insert Business Rule on the sc_req_item table to populate the RITM Parent with the same.

(function executeRule(current, previous /*null when async*/) {
	current.parent = current.request.parent;
})(current, previous);

 

No, it isnt populating the parent field on the REQ which gets created from the UI Action