Force adding comment when attaching a file

imrane
Kilo Expert

Hi everyone,

I used "Ticket Conversation" widget in the Ticket Form on Service Portal

It is all OOTB

When a user add an attachment to an Incident, no notification on ITIL user are triggered, nor Business Rule

Indeed, there is no filter condition of type : "Additionnal Attachement : changes" as the existing "Additionnal Comments : changes"

To find a workaround, I want to force user to add a comment to allow them to add an Attachement

So that, adding an Attachement will triggers Notifcation and Business Rule because of "Additionnal Comments : changes"

Do you have any idea how can I manage to do this ?

Thanks

1 ACCEPTED SOLUTION

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Imrane,



Do you want to try creating a Business Rule on the sys_attachment table with the condition for table name?



Asking for a comment for attachment doesn't look like a good user experience and also user might end up entering some random text.



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin


View solution in original post

5 REPLIES 5

Chuck Tomasi
Tera Patron

If you want to notify someone that an attachment has been made, I wouldn't go through the trouble of making the comment mandatory. I'd use the event driven notification based off the "attachment.uploaded" event. You can use the two event parameters to know exactly which table and record were impacted.



find_real_file.png



Scripting for Email Notifications - ServiceNow Wiki


Email Notifications - ServiceNow Wiki


Events and Email Notifications - ServiceNow Wiki


Thanks a lot !



I'll give it a try and let you know it was successful.


Ok then.



What I tried :


  • Add a Business Rule on sysevent
    • When "Before" Insert
    • Filter Condition :
      • Parm1 is "incident"
      • Name is "attachment.uploaded"
    • Advanced ;
      • gs.log("event bs test : " + current.parm1)
  • Thant I add attchement to some incident. My Business Rule won't trigger


Why I'm doignt that, instead of using notification directly as you said ? I'm trying to use all behavior of incident :


  • Instead of my gs.log in "advanced" section, I will update an incident gliderecord : (where sys_id is parm2)
    • For instance, adding a work_note ou a comment
    • I hope this will trigger other Business Rule I already have on Incident
      • Notification of course,
      • But also change state of incident wether it is on hold or not ...

antin_s
ServiceNow Employee
ServiceNow Employee

Hi Imrane,



Do you want to try creating a Business Rule on the sys_attachment table with the condition for table name?



Asking for a comment for attachment doesn't look like a good user experience and also user might end up entering some random text.



Hope this helps. Mark the answer as correct/helpful based on impact.



Thanks


Antin