Duplicate Change Tasks getting created when 'Copy Change' UI action is used

Aayushi Sharma
Tera Contributor

Hello Folks,

 

While using 'Copy Change' UI action, we have observed that the Change tasks are getting doubled.

For example, Change A has 2 Change tasks and I create a copy of that change, I see 4 change tasks in the copied change.

 

Is this a known issue?

8 REPLIES 8

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Aayushi Sharma 

 

Yes, this is expected because these tasks get copied from the previous change, and two new tasks will be created from the new change as the flow triggers.

We had the same issue and resolved it by creating a new UI action that is a copy of the original "Copy Change." We then commented out the code related to the change task functionality.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

HI @Dr Atul G- LNG ,

 

But our tasks which are duplicating are actually manual tasks and not the ones which are created from flow.

Hi @Aayushi Sharma 

 

Is still open?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Sanjay Bagri1
Tera Guru

Hello @Aayushi Sharma ,

 

Please could you validate from the OOB Copy Change UI action. Because i have tested in my PDI as well as real instance there is no difference and i am getting only correct task created like if i have created 2 task then 2 tasks are getting copied in new copy change.

 

//This is the OOB code can you compare with your code. 

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');
	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();
		}
	});
}

 

SanjayBagri1_0-1749109588121.png

Copied Change with 2 task only 

SanjayBagri1_1-1749109644064.png

 

 

 

Thanks

Sanjay Bagri