- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 12:29 AM
I am making field assigned to Non-mandatory while resolving when there is an external reference record attached over the related list of incident, for this i have written script include and client script and not getting solution
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 01:27 AM
Hi @ABC6 , Is the current user part of the assignment group you selected? If he is not, then it is directly returning false, even if the reference record exists in 'u_external_references' table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 12:34 AM
Hello @ABC6 ,
Please try the below once and check.
Script include function:
isUserMember: function() {
var userGrp = new GlideRecord('sys_user_grmember');
userGrp.addQuery('user', this.getParameter('sysparm_usr'));
userGrp.addQuery('group', this.getParameter('sysparm_grp'));
userGrp.setLimit(1);
userGrp.query();
if (userGrp.next()) {
var incidentId = this.getParameter('sysparm_is_external_reference');
var gr = new GlideRecord('u_external_references');
gr.addQuery('u_task', incidentId);
gr.setLimit(1);
gr.query();
// Check if there's an external reference for the incident
if (gr.next()) {
return true;
} else {
return false;
}
} else {
return false;
}
},
Client script:
if (g_form.getViewName() == 'sow_incident_resolve_modal' || g_form.getViewName() == 'ui16_incident_resolve_modal') {
if (isLoading || newValue === '') {
g_form.setMandatory('comments', true);
g_form.setMandatory('assignment_group', true);
}
if (g_form.getValue('assigned_to') == '') {
var getGroup = new GlideAjax('ResetAssignee');
getGroup.addParam('sysparm_name', 'isUserMember');
getGroup.addParam('sysparm_usr', g_user.userID);
getGroup.addParam('sysparm_grp', g_form.getValue('assignment_group'));
getGroup.addParam('sysparm_is_external_reference', g_form.getUniqueValue());
getGroup.getXML(FCRAssignmentGroup);
}
}
function FCRAssignmentGroup(response) {
var ans = response.responseXML.documentElement.getAttribute("answer");
alert(ans);
if (ans == 'true') { // Adjusted to check against the string 'true'
g_form.setMandatory('assigned_to', false);
} else {
g_form.setMandatory('assigned_to', true);
}
}
Please mark it helpful/correct if this helps you.
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 12:51 AM
Not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 12:55 AM
Hello @ABC6 ,
Can you put a log/alert for the record if it going inside false also just print the reference record value and see.
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2025 01:01 AM
i have put the alert to print answer and i am getting the false value on alert