How to make attachments mandatory on SC_TASK

VickyRai1
Tera Contributor

Hello all,

 

I have a requirement for making attachment mandatory on sc_task, but i have multiple catalog task and i want to make attachment mandatory on a particular task. please let me know how we can achieve it.

 

Thanks in Advance

1 ACCEPTED SOLUTION

Shubham Pal
Tera Expert

Hello VickyRai1,

 

Please use the below code in Business Rule 

 

(function executeRule(current, previous /*null when async*/) {

// gs.addInfoMessage("Result:"+current.hasAttachments());

if(current.hasAttachments() != true){

gs.addInfoMessage("Please add an attachment");

current.setAbortAction(true);

}}

)(current, previous);

 

And set When to run as before , update.

use condition as requested item.item is "catalog item name".

and state changes to closed complete.

View solution in original post

5 REPLIES 5

Thankyou So much Shubham Pal,

This works Fine.