- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 10:56 AM
On change of "Assigned to" field, display information about active assigned incidents count of corresponding agent selected under the "Assigned to" field.
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2022 10:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 11:45 AM
Instead of doing an alert if it is temporary I would use g_form.showFieldMsg('assigned_to', 'Total Assigned incident count for this user: ' + result, 'info');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2022 11:52 AM
Not a bad idea at all Brian. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2022 09:00 AM
Whenever "Assigned to' field populated with a new agent, active assigned incidents count should be displayed as a info message under the 'Assigned to' field.
Message should be cleared, if "Assigned to" field is empty.
No message should appear after updating the incident record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2022 09:20 AM
Updated client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
var rec = new GlideAjax('getAssignedToCount');
rec.addParam('sysparm_name', 'getAssignedTo');
rec.addParam('sysparm_assignedto', newValue);
rec.getXML(populateData);
// When the response is back from the server
function populateData(response) {
var answer = response.responseXML.documentElement.getAttribute('answer');
var result = JSON.parse(answer);
if(newValue != ''){
g_form.showFieldMsg('assigned_to','This user has ' + result + ' incidents already assigned','info');
}else{
g_form.hideFieldMsg('assigned_to');
}
}
}
Please mark as correct answer if it fits your requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2022 10:25 AM
Thanks Dan