remove attachment on incident inbound action or condition

Les1
Tera Guru

Requirement is for inbound email created incidents of a certain condition (category) to delete any attachment on the incident created. Idea is that for a certain group handling security ops type of tickets, we don't want malicious payloads being attached to the ticket (we dont have the secops module yet).

Guessing this cant be done via the inbound action, so presuming a business rule or other will be needed.

this thread looks promising but i'm not figuring out how to convert it to work for incident tickets.

any advisement appreciated, thanks. 

1 ACCEPTED SOLUTION

Here is the easy method with script. 

1. Go to Business Rules

2. Select table as "Incident"

3. select "Advanced = true"

4. Go to "When to run" tab and add condition as "Category = <Your_category>"

5. When = before

6. Insert = true

7. Add the following script

(function executeRule(current, previous /*null when async*/) {
	
	var attach = new GlideSysAttachment();
	attach.deleteAll(current);
	
})(current, previous);

Let me know how that goes or if you have any questions. Mark this thread as answered if this helps resolve your issue. 

View solution in original post

6 REPLIES 6

Wow that was much simpler than the script i was attempting and appears to work great in my initial testing. thank you Raghu!

Hi Raghu,

I tried using the same script mentioned by you but it didnt work in my case.

However, I wanted to point out that I am using the exact similar function on case table - sn_customerservice_case which belongs to the Customer Service Application Scope.

Will the application scope change have any effect? I have no clue why the attachments arent getting deleted on insert through inbound email actions. 

Regards,
Wasim