Scenario Based Question - ITSM

priyayadav8
Tera Contributor

Whenever an Incident's priority changes to P1, you want to notify the user and make attachments mandatory .How to achieve this?

1 ACCEPTED SOLUTION

Sarthak Kashyap
Mega Sage

Hi @priyayadav8 ,

 

I tried your problem in my PDI and it works for me please create OnBefore Business Rule on your Incident table, and add below script

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

    // Add your code here
    gs.log("Inside BR");
    if (current.priority == 1 || current.priority == "1") {
        if (current.hasAttachments() != true) {
            gs.log("Inside BR IF");
            gs.addErrorMessage("Please add an attachment");
            current.setAbortAction(true);
        }
    }


    gs.eventQueue('Event_Name', current, current.caller_id, current.assigned_to);

})(current, previous);

SarthakKashyap_0-1763290346968.png

 

SarthakKashyap_1-1763290347987.png

 

 

You can create a event from event Registry and create a Notification, trigger that notification when event is fired, and in who will receive section check the checkbox of recipient contains parm1 &parm2. Add your subject and body accordingly.

SarthakKashyap_2-1763290346971.png

 

SarthakKashyap_3-1763290346970.png

 

 

 

Result

SarthakKashyap_4-1763290346968.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards,

Sarthak

View solution in original post

5 REPLIES 5

Yes It's working 
Thanks