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

Abbas_5
Tera Sage
Tera Sage

Hello @LuboHan,
For similar kind of requirement, please refer to the link below:
https://www.servicenow.com/community/itsm-forum/how-can-we-propose-all-p1-incidents-as-major-inciden...

 

If it is helpful, please mark it as helpful and accept the correct solution.
Thanks & Regards,
Abbas Shaik

Deepak Shaerma
Kilo Sage

Hi @LuboHan 

Create a client script that runs when the form loads. In the client script, check the value of the priority field. If the Priority is not 1 - Critical or Priority is not 2 - High, disable the propose and promote button using JavaScript.

Please mark this as helpful or accepted if this solves your query

 

LuboHan
Mega Expert

Hello guys, so actually 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 "canPromoteMIC" & "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 🙂 

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! 🙂