FAFR to set priority based on other change fields

FAFR to set priority based on other change fields

Requirement:
Set priority based on 3 change fields.  i.e Change Additional field - "Coverage", "Impact" and "Urgency".

Steps to configure:
1.  Goto Admin > Change Templates > Field and Form Rules > On Field Change:  Urgency.
2.  Set Conditions as:  Coverage is not empty, Impact is not empty and Urgency is not empty.
3.  Execute Script:   Paste the attached script. Update the change additional field value as per your instance.



Script:
var Priority_Matrix = {
  "Coverage 4": {
    "Impact 4": {
      "Urgency 4": "Critical",
      "Urgency 3": "High",
      "Urgency 2": "Medium",
      "Urgency 1": "Low"
    },
    "Impact 3": {
      "Urgency 4": "High",
      "Urgency 3": "High",
      "Urgency 2": "Medium",
      "Urgency 1": "Low"
    },
    "Impact 2": {
      "Urgency 4": "Medium",
      "Urgency 3": "Medium",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    },
    "Impact 1": {
      "Urgency 4": "Low",
      "Urgency 3": "Low",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    }
  },
  "Coverage 3": {
    "Impact 4": {
      "Urgency 4": "High",
      "Urgency 3": "High",
      "Urgency 2": "Medium",
      "Urgency 1": "Low"
    },
    "Impact 3": {
      "Urgency 4": "High",
      "Urgency 3": "Medium",
      "Urgency 2": "Medium",
      "Urgency 1": "Low"
    },
    "Impact 2": {
      "Urgency 4": "Medium",
      "Urgency 3": "Medium",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    },
    "Impact 1": {
      "Urgency 4": "Low",
      "Urgency 3": "Low",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    }
  },
  "Coverage 2": {
    "Impact 4": {
      "Urgency 4": "Medium",
      "Urgency 3": "Medium",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    },
    "Impact 3": {
      "Urgency 4": "Medium",
      "Urgency 3": "Medium",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    },
    "Impact 2": {
      "Urgency 4": "Low",
      "Urgency 3": "Low",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    },
    "Impact 1": {
      "Urgency 4": "Low",
      "Urgency 3": "Low",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    }
  },
  "Coverage 1": {
    "Impact 4": {
      "Urgency 4": "Low",
      "Urgency 3": "Low",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    },
    "Impact 3": {
      "Urgency 4": "Low",
      "Urgency 3": "Low",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    },
    "Impact 2": {
      "Urgency 4": "Low",
      "Urgency 3": "Low",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    },
    "Impact 1": {
      "Urgency 4": "Low",
      "Urgency 3": "Low",
      "Urgency 2": "Low",
      "Urgency 1": "Low"
    }
  }
};
var coverage = $CS.getText("UDF_CHAR1");  // Update with the change UDF field name as per your instance.
var impact = $CS.getText("IMPACT");
var urgency = $CS.getText("URGENCY");
$CS.setText("PRIORITY",Priority_Matrix[coverage][impact][urgency]); 

      • Related Articles

      • How to create a change automatically based on a schedule

        This is a sample python script that triggers the creation of a Change Request in ServiceDesk Plus using the Change API based on a schedule Note:  Attached script will not work beyond 11138 SDP Version. ​ A short guide on setting up python is ...
      • Dynamically set SLA based on field values

        Requirement: SLA for service requests needs to be set depending on the category, subcategory and priority of the request. Usecase: The possibility to modify/set SLA depending on a request Field is not available in Service Request. Also, since SLA is ...
      • How to automatically assign users to different roles in a change request.

        This script is applicable only for builds prior to 11138. This is a sample python script to read the value in the Change Owner field, when a Change Request is created and set him/her as the Change Implementer automatically, using Change Custom ...
      • Set CAB based on change type

        Requirement: Set CAB members depending on the change type chosen, every time a change request is created. Steps to follow: Goto Admin > Developer Space > Global function > New > Paste the content from the attachment  Global_function_4.txt  and save ...
      • Priority change from history

        To make any changes to a query, refer to the KB article below. https://pitstop.manageengine.com/support/manageengine/ShowHomePage.do#Solutions/dv/24000633501275 SELECT wo.WORKORDERID "Request ID", wo.TITLE "Subject", qd.QUEUENAME "Group", ...