1.In change Form - Based on the Service selected , Assigned group has to be poppulate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 11:57 PM
Hi Team ,
we have requirement that , In change request , Based on the Service selected , that Service Support group has to be populate in the Assignment group .
See in the Below screenshot , Service is Firewall NonProd and the Support Group is TCS-Network-SUP >> And the Same support group has to be populate in the assignment group .
How to fulfill this requirment , can any one please provide script for this , Please provide screenshot for better understanding .
Please provide test cases screenshot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2024 12:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2024 12:21 AM - edited 10-03-2024 12:22 AM
Sure
Create On change Client script on Service Field
// Only proceed if the new value is not empty
if (newValue) {
var ga = new GlideAjax('SupportGroupUtil');
ga.addParam('sysparm_name', 'getSupportGroup');
ga.addParam('sysparm_service_sys_id', newValue);
ga.getXMLAnswer(handelResponse);
function handelResponse(answer)
{
var supportGroupSysId =answer;
// Set the assignment group field (change 'assignment_group' to your actual field name)
g_form.setValue('assignment_group', supportGroupSysId);
}
}
script include
getSupportGroup: function() {
var supportGroup = ''; // Default value if not found
var serviceSysId = this.getParameter('sysparm_service_sys_id'); // Get the service sys_id passed from the client script
if (serviceSysId) {
var serviceGr = new GlideRecord('your_service_table'); // Replace with your actual service table name
if (serviceGr.get(serviceSysId)) {
supportGroup = serviceGr.support_group.sys_id.toString(); // Adjust the field name as necessary
}
}
Please mark this response as Correct and Helpful if it helps you can mark more that one reply as accepted solution
return supportGroup;
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2024 02:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2024 03:33 AM
@nameisnani
Create a script include with this name "SupportGroupUtil" dont give any spaces