Making 'Assigned to' mandatory on resolution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2009 08:14 AM
Hello
I'm a newbie here, implemented Service-now today and this is my first post.
I've had a quick scan of the forum and I've seen some topics that have touched on this - but not being a Java whiz I've not been sure how to tweak the script.
What I want to do is make the 'Assigned to' field mandatory on resolution or closure. At present it's not a mandatory field as we want to assign to groups, but when the Incident is resolved, we need to see who dealt with it.
At present it's possible to resolve an incident whilst leaving the 'Assigned to' field blank.
Any advice appreciated.
Regards
Karen
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2015 09:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2015 08:32 PM
Hi Chris - how we have it set
- OnLoad - checked
- Global - checked
- Reverse if false - checked
Ensure you are using the correct field - out of the box ours is "Status"
UI Policy Action
- Field Name: assigned_to
- Mandatory: True
- Visible: Leave Alone
- Read Only: Leave Alone
- Policy Action Type: UI Policy Action
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2016 11:34 AM
Try this:
UI Action:
Name: Close Task
Table Catalog Task [sc_task]
Order 100
Action Name close_sctask
Active Checked
Show Insert Checked
Show Update Checked
Client Checked
Form Button Checked
Application Global
On Click closeSCTask()
Condition current.state ❤️ && current.approval != 'requested'
Script
//ensure that assigned to is required.
function closeSCTask(){
if (g_form.getValue('assigned_to') == '') {
g_form.setMandatory('assigned_to', true);
g_form.showFieldMsg('assigned_to','Assigned to is required when closing a ticket','error');
alert('Assigned to is required when closing a ticket');
return false;
}
If you want to make anything else mandatory (Notes, Phone number etc) just copy the text and add it after the last "}" but start it off with if as such:
//ensure that worknotes are required.
function closeSCTask(){
if (g_form.getValue('work_notes') == '') {
g_form.setMandatory('work_notes', true);
g_form.showFieldMsg('work_notes','Work Notes are required when closing a ticket','error');
alert('Work Notes are required when closing a ticket');
return false;
}
//ensure that assigned to is required.
if (g_form.getValue('assigned_to') == '') {
g_form.setMandatory('assigned_to', true);
g_form.showFieldMsg('assigned_to','Assigned to is required when closing a ticket','error');
alert('Assigned to is required when closing a ticket');
return false;
}