Make fields mandatory in list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 02:32 AM
Hi all,
Could you help me with how to make fields mandatory in list view when user tries to resolve it from list view, the fields to be mandatory are ci,close code and close notes.
Note: Need help to achieve without UI Policy as it is affecting the integration updates.
Thanks
Abid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 02:36 AM - edited 03-21-2025 02:37 AM
Hello @AbidJafrey
Use the oncellEdit client script for this requirement and make the changes accordingly
if any thing else please let me know
If you found this helpful, please give a thumbs up OR mark it as the solution. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 02:37 AM
Hi @AbidJafrey
You can use the oncell edit client script and add the condition.
-
function onCellEdit(sysIDs, table, oldValues, newValue, callback) { var saveAndClose = true; var isAdmin = g_user.hasRole('admin'); if ((!isAdmin && newValue == 2) || (!isAdmin && newValue == 3)){ alert('Not allowed to set this state'); saveAndClose = false; } callback(saveAndClose); }
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 02:39 AM
We dont have to stop the incident from resolving, instead we have to make them fill the close code, close notes and configuration item field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2025 02:49 AM
Hell @AbidJafrey
your logic is like
if(state == 'backend value of resolved')
if(cmdb_ci == '' && close_code == '' && close_notes == ''){
put error msg to fill out the ci,close codes and close notes
saveAndClose = false;
}
else{
saveAndClose = true;
}
please take the help from this logic and make the changes accordingly and let me know if anything else
If you found this helpful, please give a thumbs up OR mark it as the solution. Thank you!