Create a business rule on Issues such that if the caller of issues is a “VIP” user the issues opened should always be with Priority 1.

VISHAL69
Tera Contributor

Create a business rule on Issues such that if the caller of issues is a “VIP” user the issues opened should always be with Priority 1.

(function executeRule(current, previous /*null when async*/) {
var gr=new GlideRecord("incident");
gr.query();
if(caller.caller.vip=='true')
{gr.setValue("impact")=="1";
gr.setValue("urgency")=="1";
gs.addInfoMessage("Priority is 1");
}
// Add your code here

})(current, previous);

 

I am using before insert BR. Its not working.... can anyone tell me the mistake with solutions. Thanks in advance

 

1 ACCEPTED SOLUTION

Willem
Giga Sage
Giga Sage

Try this:

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

    if (current.caller_id.vip == true) {
        current.impact == "1";
        current.urgency == "1";
        gs.addInfoMessage("Priority is 1");
    }

})(current, previous);

View solution in original post

3 REPLIES 3

Willem
Giga Sage
Giga Sage

Try this:

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

    if (current.caller_id.vip == true) {
        current.impact == "1";
        current.urgency == "1";
        gs.addInfoMessage("Priority is 1");
    }

})(current, previous);

current.impact = "1";

current.urgency = "1";

Right?

Vishakha
Mega Guru

Hi Vishal,

Try this one current.caller_id.vip == true

 

Please let me know if you have any questions.

Please mark correct and helpful if you find my response worthy based on the impact.

Regards,

Vishakha Pradhan