We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

trigger email notification when an attachment is added to an incident

snowdev199202
Kilo Contributor

Hi Folks ,

 

 

I am trying to trigger a notification with below body content , could you please help me on this 

 

1 . You can view the attachment by clicking the link

 

2 . *[link should take them to the incident.]

 

snowdev199202_0-1707228131333.png

 

 

 

Created Event(incident table) , notification(incident table) , Business rule (attachment table)

 

Business rule : 

 

var incAtt = new GlideRecord('incident');
        incAtt.addQuery(current.table_sys_id,incAtt.sys_id);
        incAtt.addEncodedQuery('assigned_to=');
        incAtt.query();
        if (incAtt.next()) {

            var group = incAtt.assignment_group;
           
            if (incAtt.get(current.table_sys_id)) {

   var createB =current.sys_created_on+","+current.sys_created_by;

                gs.eventQueue('incident.attachment.add',current,group,createB);


                }


                }
 
 

 

Thanks in advance

0 REPLIES 0