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]); 

                  New to ADManager Plus?

                    New to ADSelfService Plus?

                      • 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 ...
                      • Dynamic loading of field data from an external CSV file

                        Requirement: Load data to additional fields dynamically from an external CSV file based on another field value. Usecase: Assume, a request template includes three additional fields: 'Client Code,' 'Client Name,' and 'Client Address.' When a pick-list ...
                      • 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 ...
                      • 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", ...
                      • Risk matrix for Change using Custom module

                        UseCase: Risk need to be calculated through Risk matrix (similar to Priority matrix in the request module) Steps to configure: Configure custom module as in the attached screenshot. 1. Navigate to Admin --> Developer space --> Custom module --> ...