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

ok if caller has securonix admin. role you want to update the Priority to 1 right?

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

Shyamkumar

Hi Shyam,

 The requirement is :

If User is securonix admin, then the below following field should work :

 

impact=1

urgency =1

Priority = High

If impact =2

urgency = 2

Priority = medium

impact =3

urgency = 3

Priority = low

Please help me with the script

@ShiningStar1  , how can you put multiple Priorities if role matches , I hope you want to Set Priority to 1 , can you get the Clarity on the Requirement

 

Regards,

Shyamkumar

 

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

Shyamkumar

Hi James,

 

Here is my client script :


    if (getimpact == '1' && geturgency == '1' &&    caller_id.role == 'securonix_admin')

    {
        g_form.setValue('priority', '1');
 
Kindly help.

SunilKumar_P
Giga Sage

Hi @ShiningStar1, if the requirement is to check the role for logged in user then you can try the below script.

 

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }

    var impact = g_form.getValue('impact');
    var urgency = g_form.getValue('urgency');

    if (g_user.hasRole('securonix_admin')) {
        if (impact == 1 && urgency == 1) { //Assuming 1 as High
            g_form.setValue('priority', 1);
        } else if (impact == 2 && urgency == 2) {
            g_form.setValue('priority', 2); //Assuming 2 as Medium
        } else if (impact == 3 && urgency == 3) {
            g_form.setValue('priority', 3); // Assuming 3 as Low
        }
    }

}

 

 

Regards,

Sunil