Display Business Rule

ShiningStar1
Tera Contributor

Hello All,

 

Hello All,

Kindly help me with the below requirement,

If User is securonix admin.

impact=1

urgency =1

Priority = High

If impact =2

urgency = 2

Priority = Low

I have written a display business rule for it, but it does not work:

function executeRule(current, previous /*null when async*/) {

    if (current.impact == 1 && current.urgency == 1 && current.caller_id.user_name == 'securonix admin'){

current.priority = 1;

})(current.previous);

 

Please help me with the script as it doesnot work .

15 REPLIES 15

Thanks for that, but just realized that there is a better way to do this.

There is an OOTB process that calculates the priority via the Data Lookup.

Normally, you use only the Impact and Urgency to calculate the priority but since you need an additional parameter (i.e. caller) for your case, I think you can create a custom data lookup table. 

Please refer to the link below for the details

https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/field-admini...

 

Thanks

Hi James,

I have tried in this way but this did not work because here the condition is caller is securonix admin.

 

 

If you have a look at the document, you will see that in the example, it creates new fields including the caller as well.

@ShiningStar1  , use this in on Change Client Script based on the Change of Caller ID 

 

 

var caller = g_form.getReference('caller_id', callBackFunc);
}
function callBackFunc(caller)
{
if(caller==''){ //Pass the Sysid of the securonix_admin user

g_form.setValue('priority',1);
}
}

 

 

Regards,

Shyamkumar 

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Hi Shyam,

Thankyou for your reply .But the 

 

If User is securonix admin.

 

impact=1

urgency =1

Priority = High

If impact =2

urgency = 2

Priority = Medium

if impact = 3

urgency = 3

Priority = Low