Related Actions rule set in PD

Hi Guys,

I am working on a requirment like when a problem ticket is resolved it shoud automatically send  notifications to all related incident contact person.

I am trying to run this using PD "Run Action on Related Records" rule set. I can use the Incident values in the notification, but i am not able to refer or use the problem ticket number (Source record) in the Notifications.

Can someone help me how this can be achieved in PD .

 

 

  • You should be able to accomplish this with a Run JavaScript rule type in the transition from the last open phase to the closure phase. I haven't tested this and just whipped it up over some coffee, but I think should do the trick:

    var to = new Array();
    var rel = new SCFile("screlation");
    var relRc = rel.doSelect("source=\""   record.number   "\" and depend.filename=\"probsummary\"");
    
    while (relRc == RC_SUCCESS) {//start loop
    
       var im = new SCFile("probsummary");
       var imRc = im.doSelect("number=\""   rel.depend   "\"");
       
       if (imRc == RC_SUCCESS) {
              to.push(rel.contact_name);   
             }
    
       relRc = rel.getNext();}//end loop
       
    
    if (to != null) {//start notification call
    
       vars.$relatedRecipients = to;
     
       var ret = new SCDatum();
       var rteNames = new SCDatum();rteNames.push("name");rteNames.push("record");
       var rteValues = new SCDatum();rteValues.setType(8);
    
       rteValues=system.functions.insert(rteValues, 0, 1, "NAME OF YOUR NOTIFICATION");
       rteValues=system.functions.insert(rteValues, 0, 1, record);
    
       system.functions.rtecall("callrad",ret,"us.notify",rteNames,rteValues,false);
    
       }//end notification call

    Make sure that the recipient in your notification is set to $relatedRecipients.

    Caveat: My main customer isn't using PD yet :(, so I haven't done too much JS in PD - therefore, I'm not sure if you should use record or $L.file, so you might try the other if one doesn't work.