Doer & Checker Validation

mounika36
Giga Contributor

In order to address an audit violation, my Services needs to validate that the Implement Change (Doer) & the Check Implementation (Checker) tasks are not assigned to the same person. The assignment group can be the same, but the Assigned to, should be a different person

6 REPLIES 6

Ok, so I am hoping there is some Task Type for that validation task as well based on which here is the script.

Client script on Change of Assignee

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

var assignee = g_form.getValue('assigned_to');
var id = g_form.getValue('change_request');
var ctask_type = g_form.getValue('change_task_type');
if(ctask_type == 'Implementation')
{
var Ajax = new GlideAjax("checkUser");
Ajax.addParam("sysparm_name","validateChecker");
Ajax.addParam("sysparm_user",assignee);
Ajax.addParam("sysparm_id",id);
Ajax.getXML(getVal);
}
if(ctask_type == '<ctask type of validation>')
{
var Ajax1 = new GlideAjax("checkUser");
Ajax1.addParam("sysparm_name","validateImplementer");
Ajax1.addParam("sysparm_user",assignee);
Ajax1.addParam("sysparm_id",id);
Ajax1.getXML(getVal1);
}
function getVal(response) {
var answer = response.responseXML.documentElement.getAttribute('answer');
if(answer == "true")
{
alert('Checker cannot be same as the Implementer.');
g_form.setValue('assigned_to',"");
}
}
function getVal1(response) {
var answer1 = response.responseXML.documentElement.getAttribute('answer');
if(answer1 == "true")
{
alert('Implementer cannot be same as the Checker.');
g_form.setValue('assigned_to',"");
}
}
}

Script Include:

find_real_file.png

Please write similar function for validateImplementer.

 

Hi Jyothsna,

Did provided solution work for you?