Skip to content

Commit 6dba56b

Browse files
getAssignedToCount.js
1 parent 06c5594 commit 6dba56b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
function onChange(control,oldValue,newValue,isLoading,isTemplate) {
2+
if(isLoading || newValue === '') {
3+
return;
4+
}
5+
6+
var ga = new GlideAjax('countAssignedUtil');
7+
ga.addParam('sysparm','getCount');
8+
ga.addParam('sysparm_assignedto', newValue);
9+
ga.getXML(callback);
10+
11+
function callback(response){
12+
var answer = response.responseXML.documentElement.getAttribute("answer");
13+
if(answer >=5){
14+
g_form.addErrorMessage("Please select another person to work on this Incident, selected user is already having 5 tickets in his/her Queue");
15+
g_form.setValue("assigned_to", "");
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)