UI action script for change any value to Service Desk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 10:19 PM
Hello Everyone,
I need a requirement of UI action in which If user is select any group in assignment group the group changed to 'Service Desk' i try many time but it is not display my field just getting empty.
For the help Thanks in advance
Best Regards,
Suyash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 11:31 PM - edited ‎01-23-2024 11:33 PM
Hi @Suyash Joshi
I have created 'Set to Service Desk' UI action on incident table for your reference.
Condition: gs.hasRole('itil') && current.assignment_group != gs.getProperty('Service Desk group')
'Set to Service Desk' button will be visible only when the logged-in user has itil role and the 'Assignment group' field is not 'Service Desk' group. You can modify it as per your requirement.
Script:
Some incidents may already contain 'Assigned to' field set and that user may not be a member of service desk group. So, it causes issue. Hence, clearing assigned to field whenever the 'Set to Service Desk' button is clicked.
// Server-side script for the UI action
if (typeof window == 'undefined') {
// Set the 'Assignment Group' to 'Service Desk'
current.assignment_group = gs.getProperty('Service Desk group');
// Clear the 'Assigned to' field
current.assigned_to = '';
// Update the record with the new values
current.update();
// Redirect the user to the updated record
action.setRedirectURL(current);
}
You also need to create new system property that will contain sys_id of 'Service Desk' group
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 11:42 PM
Hi @Iraj Shaikh
It seems your logic is true but it is not working I want to display value of service desk if any assignment group is select.