Need a script to check assignment group manager name

jayaprakash1998
Tera Contributor

Hi All,

Can anyone please help me with a client script ?

Requirement :

If user select assignment group in incident then show alert message, alert message should have the name of the assignment group manager and assignment group name.

 

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@jayaprakash1998 Here is how you should configure an onChange client script on your incident form.

 

Screenshot 2023-10-30 at 11.25.16 PM.png

Here is the script.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    //Type appropriate comment here, and begin script below
    var assignment_group = g_form.getReference('assignment_group',callback);

	function callback(group){				
		g_form.setValue('assigned_to',group.manager);
		var manager = g_form.getReference('assigned_to',anotherFunc);
		function anotherFunc(caller){
			alert('Group Name: '+group.name + ' Group Manager: '+caller.name);
			g_form.clearValue('assigned_to');
		}
	}
    
}

Hope this helps.

View solution in original post

7 REPLIES 7

Hi @Utpal Dutta thankyou this is very helpful

Narasimman7
Tera Contributor

Sandeep Rajput
Tera Patron
Tera Patron

@jayaprakash1998 Here is how you should configure an onChange client script on your incident form.

 

Screenshot 2023-10-30 at 11.25.16 PM.png

Here is the script.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    //Type appropriate comment here, and begin script below
    var assignment_group = g_form.getReference('assignment_group',callback);

	function callback(group){				
		g_form.setValue('assigned_to',group.manager);
		var manager = g_form.getReference('assigned_to',anotherFunc);
		function anotherFunc(caller){
			alert('Group Name: '+group.name + ' Group Manager: '+caller.name);
			g_form.clearValue('assigned_to');
		}
	}
    
}

Hope this helps.