Project and Portfolio Management Practitioners Forum
cancel

copy attachment from parent request

Highlighted
chateau_1
Trusted Contributor.

copy attachment from parent request

Hi,

We have a requirement that if the parent request has an attachment, the same attachment needs to be copied over to the child request systematically as well.  I'm aware of the checkbox "Copy request references" when you select the "Make a copy" button but the requirements is to have this be done automatically, not manually.  I have used the 'ksc_copy_request' but it only copies the data and creates the reference, but not save the attachment onto the child ticket.

Has anybody done this or can give me a hint on how to do this?

Thanks in advance.
Catherine

6 REPLIES
SandraL
Regular Contributor.

Re: copy attachment from parent request

We have the same issue here, and need to get it resolved this year.  

We have had some discussion around on how we may try to solve it.  The options will likely depend on what your attachments are, and what domument management system you use.  We are still using the File system for now.  

I will be very interested in how others have solved this problem successfully.

We also have a similar issue with "User Notes" in that we want those also copied to our auto-created subsequent/dependent requests, so important information is not lost.

hyllplan
Honored Contributor.

Re: copy attachment from parent request

Use shell script to copy the file. Files are located under ppm_root/attachements folder, load balanced in folders 01-99 (based on the sequence used in related oracle table.
Update the oracle table related to attachements (dont remember the name now). Should then be available.
Derek Giedd
Honored Contributor.

Re: copy attachment from parent request

We attach a template to all proposals. I am attaching the method we use,  You will need to modify this to get the source file from the attachments folder of the parent request but the rest of the technique should work.  You will also need to make a few changes for your setup.  These are indicated in the attachment. This is not the cleanest method, but PPM does not provide a way to easily do this.

 

-- Remember to give Kudos to answers! (click the KUDOS star)
chateau_1
Trusted Contributor.

Re: copy attachment from parent request

Thanks Derek, I'll give this a try.

Aurobinda
Respected Contributor.

Re: copy attachment from parent request

Hi Derek,

I am providing the below scenario for better understanding.

Request 123 is the parent request and request 456 is the child request. Now, let us consider "we could get the attachments from parent to child". Here, there is an user who have only access to child request type and not to parent request type.

Would you please let me know, if the user will be able to access the attachment.

Also, if we are copying the file/attachment using shell script and althogh vary rare but if the file is getting copied to the same folder where it's already present from the parent request, will it replace the file or how are we handling this.

Derek Giedd
Honored Contributor.

Re: copy attachment from parent request

If you want a separate copy of the file, you will need to use a shell script to copy the file then link this to the child request. The file is given a different name.  The name is in the format of <PPM Document ID>_<File Name>_<Request_ID>. So the file name will be unique. 

Another alternative is to not copy the file, but provide a link on the child request to the attachment in the parent request.  That way you only have 1 copy of the document.  We have a rule that populates this link on page load.  Here is a sample of the rule. You will need to edit this to replace the Document Name with the text you want to see on the request, the token for the Parent Request ID, the request type of the parent request, and the prompt for the attachment field in the parent request.

SELECT
'<!--HTML--><a href='|| REPLACE(sp.VALUE,'.com/','.com')||'/itg/servlet/Document?ID=' || MAX(kd.document_id) || ' target="_blank">Document Name</a>',
'<!--HTML--><a href='|| replace(sp.value,'.com/','.com')||'/itg/servlet/Document?ID=' || max(kd.document_id) || ' target="_blank">Document Name</a>'
FROM knta_documents kd,  knta_app_server_properties sp
WHERE kd.parent_primary_key = [REQD.P.PARENT_REQUEST_ID] 
    AND sp.key = 'BASE_URL'
    and sp.server_name = '__CLUSTER_DEFAULT__'
   AND kd.document_holder_id = (
       SELECT s.parameter_set_field_id 
         FROM knta_parameter_set_fields s, knta_parameter_set_contexts c, kcrt_request_types t
        WHERE s.parameter_set_context_id = c.parameter_set_context_id
          AND c.context_value = TO_CHAR (t.request_type_id)
          AND t.request_type_name = '<Request Type Name>'
          AND s.enabled_flag = 'Y'
          AND s.prompt = 'Field Prompt:') GROUP BY sp.VALUE
-- Remember to give Kudos to answers! (click the KUDOS star)