Task attached to one catalog task should reflect in other

Asmita7
Tera Expert

Hi friends,

I am working on RITM workflow.

During entire flow, I am creating 5 catalog tasks one after the other for 5 different groups. My requirement is that when a group attaches a file to catalog task then the same file should be attached to other catalog tasks (even to those which are closed complete). So at the end of RITM close, all the tasks should have same files attached.

I am thinking to write code in workflow to attach the file in next group.

For previously completed tasks, I am thinking to write a business rule to copy the attachment.

 

Please suggest.

 

Thank you 

5 REPLIES 5

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
Are you using a flow or a workflow?

 

 


Thanks and Regards,

Saurabh Gupta

@Saurabh Gupta  

 

Using workflow

Hi,
You can save the sys_id of tasks in the scratchpad variable in the respective task activity using below line of code.

workflow.scratchpad.task1_sys_id=task.sys_id;


Use above scratchpad in the next task activity with below lines of code to copy all the attachment.

var attachment = new GlideSysAttachment();
attachment.copy('sc_task', workflow.scratchpad.task1_sys_id, 'sc_task', task.sys_id);




Thanks and Regards,

Saurabh Gupta

Asmita7
Tera Expert

@Saurabh Gupta  

Thank you for your reply. I will implement and check. Will post here if any doubts.

Thanks again.