- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 06:10 AM
Hello,
I would like to make work notes a required field when an Incident is re-assigned to another group or to another user. I would like to stop the incident from getting re-assigned until the work notes has been filled out, also I'm trying to get a message that says "Please Add Work Notes When Reassigning" so the user can understand. Would anyone be able to assist?
Thank you,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 06:36 AM
Hi @kal123
You can write an Onchange client script on the assignment group
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var assignment_group = g_form.getValue('assignment_group');
if (assignment_group !== '' && oldValue !== newValue) {
g_form.setMandatory('work_notes', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 06:36 AM
Hi @kal123
You can write an Onchange client script on the assignment group
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var assignment_group = g_form.getValue('assignment_group');
if (assignment_group !== '' && oldValue !== newValue) {
g_form.setMandatory('work_notes', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 06:38 AM
Thank you! Will this also apply to the assigned_to field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 06:40 AM
yes, you can use it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 06:39 AM
Hello @kal123 ,
Follow below steps:
1. Create BR
2. Table: incident table
3. In when to run add conditions i.e., assigned to changes or assignment group changes.
4. Check advanced checkbox.
5. In advanced script use -
if (current.field_name == "") {
gs.addErrorMessage("Field abc is empty!");
current.setAbortAction(true);
action.setRedirectURL(current);
Or
use onchange client script - onchange field = assigned to or ass grp
And add logic - g_form.setmandatory('fieldname') ;
and alert() message or g_form.addErrorMessage(message).
with abort action and workflow set to false.
Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!