Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Make Comments mandatory when attachment were added to ticket.

Alekhya Nagabh1
Tera Contributor

Hi All,

 

We have an requirement where , if attachment is added to the ticket we need to make comments mandatory. 

Any help would be appreciated.

 

 

Thanks!!!

1 REPLY 1

Not applicable

Hi @Alekhya Nagabh1 ,

You can create a Business Rule and the sample advanced script :

 

SandeepDutta_2-1702472837496.png

 

(function executeRule(current, previous /*null when async*/) {
//gs.log("IDE Atta" + current.table_name + ":" + current.table_sys_id);
var gr = new GlideRecord(current.table_name);
       gr.addQuery('sys_id', current.table_sys_id);
       gr.query();
       gr.next();

gr.sys_updated_by = current.sys_updated_by;
var msg = "Ajout de pièce jointe";
       gr.comments = msg;

gr.update();

//gs.log("IDE" + gr.sys_id + " : " + gr.sys_updated_by + " : " + gr.number);

})(current, previous);