How can a case attachment or comments be copied to a task automatically?

Paul Bayani
Mega Expert

Hi! what configuration do I need to work on if I want a parent's case's files/attachments or even comments, copied/duplicate to its child task?

Thanks in advance!

1 ACCEPTED SOLUTION

Rob Sestito
Mega Sage

Hey Paul, 

I built a pretty easy UI Action on the Task form to do something like this.

Here is what I have - check it out and see if it works for you or not.

UI Action:

find_real_file.png

 

Script:

GlideSysAttachment.copy(current.parent.sys_class_name, current.parent, current.getTableName(), current.sys_id);

current.update();
action.setRedirectURL(current);

gs.addInfoMessage("Attachments have been added!");

gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');

 

And I also gave this UI action a required role as being the HR Basic.

Edit: I feel bad - did not even explain what this is doing. (sigh, c'mon Rob!!!)

So, This UI Action does the attachments. It copies all attachments from the HR Case onto the HR Task as a one-off. The person that does this, can be either the HR Case (parent) Assigned To OR the Assigned To of the child HR Task.

For Ex:

Here I have my own Password Reset Process that I built for our organization. I have a Word Doc attached to the Parent Case.

find_real_file.png

If I create a Task, I will see the UI Action 'Grab Attachments':

find_real_file.png

As you can see. there are no attachments yet on this Task. Once I click the button:

find_real_file.png

Attachment has been added to the Task form.

Now, I understand the reasoning behind wanting to grab attachments easily - but what is the reasoning behind wanting to copy over comments from Case to Task?

Cheers,

-Rob

View solution in original post

5 REPLIES 5

Hi Paul,

Can you please share your UI action script. I have the same requirements.