It's all about the answers!

Ask a question

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


Joao Carusi (263314) | asked Dec 10 '15, 2:59 p.m.
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

Accepted answer


permanent link
Donald Nong (14.5k614) | answered Dec 10 '15, 11:26 p.m.
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

2 other answers



permanent link
Brett Bohnn (94111156) | answered Dec 10 '15, 5:53 p.m.
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

permanent link
Brett Bohnn (94111156) | answered Dec 10 '15, 5:25 p.m.
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

Your answer


Register or 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.