The CreatorCon Call for Content is officially open! Get started here.

UI action to copy short description and description from incident to incident task

sparkles
Tera Contributor

Hello!

 

I need to create ui action next to submit (see below). This ui action will copy the short description and the description from the incident to the current task.

like from INC2847082 to INCTSK0653006

 

sparkles_0-1733149033532.jpeg

 

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

You can use a script like this in a UI Action with the Client box checked.  Uncomment line 6 if you want to also submit/update the task.

 

function copyFromInc() {
	var inc = g_form.getReference('incident', incInfo);
	function incInfo(inc){
		g_form.setValue('short_description', inc.short_description);
		g_form.setValue('description', inc.description);
		//gsftSubmit(null, g_form.getFormElement(), "copyinc");
	}
}

if (typeof window == 'undefined') {
	copyInc();
}
function copyInc() {
	current.short_description = current.incident.short_description;
	current.description = current.incident.description;
	current.update();
}

In this example you want the Action name to be copyinc and Onclick = copyFromInc()

 

View solution in original post

2 REPLIES 2

Brad Bowman
Kilo Patron
Kilo Patron

You can use a script like this in a UI Action with the Client box checked.  Uncomment line 6 if you want to also submit/update the task.

 

function copyFromInc() {
	var inc = g_form.getReference('incident', incInfo);
	function incInfo(inc){
		g_form.setValue('short_description', inc.short_description);
		g_form.setValue('description', inc.description);
		//gsftSubmit(null, g_form.getFormElement(), "copyinc");
	}
}

if (typeof window == 'undefined') {
	copyInc();
}
function copyInc() {
	current.short_description = current.incident.short_description;
	current.description = current.incident.description;
	current.update();
}

In this example you want the Action name to be copyinc and Onclick = copyFromInc()

 

Thank you!!!