I want all manually made child Change Tasks to be copied over to the new Change

Abhilasha G T
Tera Contributor

Hi Team,

 

when we click on copy change UI action on change form,

 

When a Change Request is copied, I want all manually made child Change Tasks to be copied over to the new Change (i.e. do not include Workflow Created Tasks, such as Change Assessment Tasks...etc.)

 

Note: As, I explored the OOB functionality, we have one UI Action with the name Copy Change it uses script Include like ChangeUtils and ChangeUtils expands the script Include of ChangeUtilsSNC.

 

We can't modify the script include since it is Read Only. Any other approach/solution to achieve this requirement.

 

Regards,

Abhilasha G T

4 REPLIES 4

Shivalika
Mega Sage

Hello @Abhilasha G T 

 

I hope you have an identifying factor to separate system created tasks and manually created change tasks. 

 

In that case you can just create a business rule, to copy over all the tasks from the change to another change. 

 

Do you want it to work only when copy button is clicked ? 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

 

Hi Shivalika,

Yes I want to achieve this, when Copy change button is clicked.

Regards,

Abhilasha G T

Hello @Abhilasha G T 

 

In that case is the "COPY" Ui action editable ? This could just be done with server script. Please share the screenshot of your copy ui action if it's editable. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Hi Shivalika ,

 

Yes, its OOB UI action and editable too, please find the details below,

AbhilashaGT_0-1742879098979.png

 

function OnCopyChangeClick() {
    function addParam(form, name, val) {
        var inp = cel('textarea', form);
        inp.name = name;
        inp.value = val;
    }

    var srcSysId = g_form.getUniqueValue();

    var ga = new GlideAjax('ChangeUtils');
     //var ga = new GlideAjax('ChangeUtilsnew');// newly created.
    ga.addParam('sysparm_name', 'getChangeQueryParams');
    ga.addParam('sysparm_src_sysid', srcSysId);
    ga.setWantSessionMessages(true);
    ga.getXMLAnswer(function (queryParam) {
        if (queryParam) {
            var gotoURL = new GlideURL('CopyChangeRelatedLists.do');
            gotoURL.setEncode(false);
            gotoURL.addToken();
            gotoURL.addParam('srcSysID', srcSysId);
            gotoURL.addParam('newSysID', '$sys_id');
            gotoURL.addParam('sysparm_returned_action', '$action');

            var form = cel('form', document.body);
            hide(form);
            form.method = "POST";
            form.action = g_form.getTableName() + ".do";
            if (typeof g_ck != 'undefined' && g_ck != "")
                addParam(form, 'sysparm_ck', g_ck);
            addParam(form, 'sys_id', '-1');
            addParam(form, 'sysparm_query', queryParam);
            addParam(form, 'sysparm_goto_url', gotoURL.getURL());
            form.submit();
        }
    });
}
 
Regards,
Abhilasha G T