cancel
Showing results for 
Search instead for 
Did you mean: 

Create Business rule that changes the priority within the service call

0 Kudos
458

Hi Team,

I need your help

Business rule that changes the priority within the service call

I want to create a business rule that changes the priority of a service call when it meets the following criteria..

Example:

1. A new field was created within the service call priority called "SUPER HIGH"

2. If I receive a service call that has "HIGH" priority

3. This service service call has type "installation"

4. I have a udf.customer in activities that contains the word "Customer VIP" on some occasions it appears with that value.

I want that when these 4 criteria are identified, they change the priority of the service call from "HIGH" to "SUPER HIGH" when found udf.customer = "Customer VIP" in a business rule.

Could you give me an example of how that business rule could be?

View Entire Topic
wendy_snyder
Associate
Associate
0 Kudos

Hi Ruben, Here's a quick example I put together. Hope I understood your scenario correctly. Copy the code to a json file and then upload that to your rules and give it a try. Please keep in mind the the rule contains the udf "customer" for the object type activity in the rule conditions.

[ {
"actions" : [ {
"executionCount" : "1",
"name" : "UpdateObject",
"parameters" : {
"fields" : [ {
"name" : "priority",
"value" : "HIGH"
} ],
"objectId" : "${serviceCall.id}",
"objectType" : "SERVICECALL",
"softUpdate" : "false",
"objectVersion" : null
}
} ],
"conditions" : [ [ {
"leftOperand" : "${serviceCall.priority}",
"operator" : "==",
"rightOperand" : "'MEDIUM'"
}, {
"leftOperand" : "${serviceCall.typeCode}",
"operator" : "==",
"rightOperand" : "'-4'"
}, {
"leftOperand" : "${activity.udf.customer}",
"operator" : "==",
"rightOperand" : "'VIP Customer'"
} ] ],
"embedded" : false,
"enabled" : true,
"eventType" : "CREATE_OR_UPDATE",
"executionType" : "ON_SUCCESS",
"lastChanged" : 1694076915798,
"name" : "SAMPLE - Service Call",
"objectType" : "SERVICECALL",
"permissionsType" : "USER",
"responsible" : "example@sap.com",
"type" : "TWO",
"skippedLogs" : false,
"variables" : [ {
"name" : "activity",
"type" : "Activity",
"value" : "activity.object.objectId = ${serviceCall.id}",
"variableType" : "OBJECT",
"version" : 43
} ]
} ]