Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How do I avoid copying attachment from ProjectA to ProjectB when using RQMCopyUtility?

How do I avoid copying attachment from ProjectA to ProjectB when using RQMCopyUtility?

I tried to use -ignoreTypes=attachment but it did not work

Steps to reproduce (I'm using RQM 502):

Created 2 Projects Areas:

ProjectA
ProjectB

Created TestCaseA / TestPlanA (added an attachment) in ProjectA


java -jar C:\RQM-Extras-RQMCopyUtil-5.0.2\RQMCopyUtility.jar -s="https://jcarusi-tp:9443/qm/service/com.ibm.com.rqm.integration.service.IIntegrationService/ProjectA" -us=CLM -pws=CLM -d="https://jcarusi-tp:9443/qm/service/com.ibm.com.rqm.integration.service.IItegrationsService/ProjectB" -ud=CLM -pwd=CLM -a=testplan,testcase -i=attachment


Excepted Results:
- See the TestCaseA and TestPlanA in ProjectB without the attachment

Actual Results:
- The TestCaseA and the TestPlanA were copied with the attachment

0 votes


Accepted answer

Permanent link
You can only use the "-nr" parameter to prevent this, but you will end up with the top level artifacts only (no references).

The attachment is a "reference" and the "-i" works for the top level artifacts in most cases. For example, if the test plan includes a test case, and you use parameters "-a=testplan -i=testcase", the test case will still be copied. It is the same as your example. Similarly, the "-nr" parameter also prevents the associated test case from being copied.

The parameter "-is" does not work for attachments in this case either (works for test phases).

Since the source code is included in the package, you can find out all the logic by reading the code. Better yet, you can modify the code and build the utility the way you want. For example
        if (processor.isRecursive()) {
            Iterator<Testplan.Attachment> attachments = tp.getAttachment().iterator();
            while (attachments.hasNext()) {
The original code only checks whether recursive mode is on before getting the attachments, you can add code to check whether the attachment artifact type has been ignored (this logic needs to added to the handler class of each artifact type if that's what you want).

Joao Carusi selected this answer as the correct answer

1 vote


2 other answers

Permanent link
Hi JP,

My idea above did not work.

I tired this:

C:\JazzServers\RQMCOPY>java -jar RQMCopyUtility.jar -s="https://clmlocal:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ProjectSource" -us=clmuser -pws=clmuser -d="https://clmlocal:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ProjectDestination" -ud=clmuser -pwd=clmuser -a=testcase -id=urn:com.ibm.rqm:testcase:5 -i=attachment

It copied test case ID 5 with its attachment.

I also tried using -i=attachment -id=urn:com:ibm:rqm:attachment:2 to see if I could ignore a specific attachment ID and it failed. I don't think that is supported.

Perhaps you will get a different answer but I cannot find a way to ignore attachments.

Thanks,
Brett

1 vote


Permanent link
Hi JP,

I did the same in 4.0.6, using -i=testscript,attachment to ensure at least the test script is ignored and the test case copied without the test script but with the attachment. So, the attachment was not ignored, the test script was.

Based on this limitation noted on the wiki https://jazz.net/wiki/bin/view/Main/RQMCopyUtility "Since the attachment resource type is not associated to a project area, only those attachments linked to another resource being copied are copied from the source to the destination. Alternatively, copy only a specific attachment resource using the -id/-artifactId argument" I will copy a single test case, e.g. -id=urn:com.ibm.rqm:testcase:1 with -i=attachment and see if the attachment is ignored.

Thanks,
Brett

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Dec 10 '15, 2:59 p.m.

Question was seen: 2,989 times

Last updated: Dec 10 '15, 11:26 p.m.

Confirmation Cancel Confirm