I need Major Incident to be proposed and promoted only from Incidents priority 1 or priority 2

LuboHan
Mega Expert

Hello All,

I need that the Incident can be Proposed to Major Incident and promote to Major Incident only if the incident is prio 1 or prio 2. Can you please help me how to achieve this?

 

Our developer instance is on release Utah. The plugin Incident Management - Major Incident Management is installed. When I create "Major Incident trigger rule" I set is as active with condition: Priority is 1 - Critical or Priority is 2 - High 

But it is not working and still the incidents prio 3-4-5 can be proposed to major incident as well, which is not desired.

 

Can you please help me where and what I should implement in order to solve it?

Thank you all in advance

1 ACCEPTED SOLUTION

LuboHan
Mega Expert

Update...

Hello guys,

so actually I managed to solved it and I will share the working solution here.

I was investigating 2 UI Actions "Propose Major Incident" & "Promote Major Incident", but my solution was not working there.

What you have to do:

  1. Go to All > Script Include
  2. Find "MajorIncidentTriggerRules"(this one you will edit and add code here) & "MajorIncidentTriggerRulesSNC"(this one you will only read)
  3. From MajorIncidentTriggerRulesSNC - find and copy 2 functions called "canProposeMIC" & "canPromoteMIC" 
  4. In MajorIncidentTriggerRules paste those 2 copied function from step n. 3
  5. In MajorIncidentTriggerRules add this code into both functions: 
  6. // check if incident is not prio 1 or prio 2 
    if (current.priority != 1 && current.priority != 2) {
    // Hide the UI Action
    return false;
            }

Than the result is as follows:

Incidents Priority: 1, 2

  • can / UI Action is visible: Propose Major Incident
  • can / UI Action is visible: Promote Major Incident

Incidents Priority: 3, 4, 5

  • can NOT / UI Action is hidden: Propose Major Incident
  • can NOT / UI Action is hidden: Promote Major Incident

I will put the whole file MajorIncidentTriggerRules as reference in the attachment.

 

Enjoy the working solution! 🙂

 

View solution in original post

5 REPLIES 5

DivyaYadav18
Tera Contributor

Hi @LuboHan ,

 

I have written below script under "Promote Major Incident" Ui action and it is working for me.

 

if(g_form.getValue('priority') == '3' || g_form.getValue('priority') == '4'){
g_form.addInfoMessage('please set an appropriate priority');
return false;
}

 

DivyaYadav18_1-1706518080865.png

 

Regards,

Divya