Copy Change Request via URL

Ariel Aharon
Giga Guru

Hi!

 

We've got an already worked on UI Action that copies change requests (not OOTB one) and there's this weird bug when we save the copied CR it'll always save it's type as Standard no matter what is the copied CR type is.

 

This is the UI Actions code:

 

 

function OnCopyChangeClick() {
    var url = '';

    url = "now/nav/ui/classic/params/target/change_request.do%3Fsys_id%3D-1%26sysparm_query%3Dchg_model%253d" + g_form.getValue('chg_model') + "%255etype%253d" + g_form.getValue('type') + "&change_id=" + g_form.getUniqueValue();

    open(url, '_blank');
}

 

 

I have tried decoding it and "cleaning" it but something always seem to break, either the fields are populated to the type is showing as Standard ever BEFORE saving the form.

 

Do have any information on how to construct this kind of URI to serve the same purpose?