- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-22-2021 04:56 AM
Hi all,
I have the following requirement:
1) If a users selects P1 or P2 as the incident priority the user is alerted with a pop-up that asks the user to confirm if they want to propse a MI
2) If the user selects continue the Propose a MI workflow is initiated.
So the confirm should only popup if the priority field CHANGES to 1 or 2, and not if it already is 1 or 2.
I have tried using the following onChange client script but does not work.
function onSubmit() {
var priority = g_form.getValue('priority');
if (priority == 1 || priority == 2) {
var response = confirm('Priority 1 & 2 tickets follow the major incident process. Please confirm that you would like to propose this ticket as a Major Incident.');
if (response == true){
gsftSubmit(null, g_form.getFormElement(), 'sysverb_mim_propose'); //MUST call the 'Action name' set in this UI Action
} else {
// If cancel is pressed or the dialog is closed the response is empty
return false;
}
}
}
the confirm function works and it pops up but the UI action does not trigger.
Please advise.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 07:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 07:26 AM
okay I managed to add the below so it wouldnt trigger on existing priorities 1 or 2.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '' || oldValue == 1 || oldValue == 2) {
return;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 07:33 AM
Good. I am assuming everything is working now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 07:39 AM
I need help with 2 things please:
1. How to check if a incident is already proposed as MI, and if it is return false.
2. when an incident form has any changes made to it, the work notes field becomes mandatory to fill in, now when priority changes, the prompt comes up for MI and when clicked OK the error appears that work notes needs filling, and the action does not trigger.
Is there a way I can prevent the work notes being mandatory for the priority field?
can you help with these two please.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 07:41 AM
this question is related to same client script ,which you have used to trigger the UI Action or is it different one ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2021 07:43 AM
yes same client script.