Can't assign (RTC) defect to (QM) executionresult via API
I'm trying to create/update a QM executionresult that, in a particular step, has a CCM workitem attached.
If I create the executionresult via Jazz web interface and then check it via API, the execution result XML looks like the following, in which the workitem is attached to a property into the stepResult object (see properties tag):
<ns16:stepResults>
<ns16:stepResult stepIndex="1" result="com.ibm.rqm.execution.common.state.passed" startTime="2022-02-11T08:55:58.000Z" endTime="2022-02-11T08:55:58.000Z">
<ns16:properties>
<ns16:property propertyName="defecto test 01" propertyValue="https://[IP]:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/26" propertyType="rtcdefectView"/>
</ns16:properties>
<ns16:startTime>2022-02-11T08:55:58.000Z</ns16:startTime>
<ns16:endTime>2022-02-11T08:55:58.000Z</ns16:endTime>
<ns16:result>com.ibm.rqm.execution.common.state.passed</ns16:result>
<ns16:expectedResult>
<div xmlns="http://www.w3.org/1999/xhtml">test</div>
</ns16:expectedResult>
<ns16:actualResult></ns16:actualResult>
<ns16:description>test</ns16:description>
<ns16:stepType>com.ibm.rqm.execution.common.elementtype.execution</ns16:stepType>
<ns16:comment/>
<ns16:compare/>
</ns16:stepResult>
</ns16:stepResults>
I've tried (all via API):
- First, I create the workitem. Then, I create the executionresult with a link to the workitem as seen above. But it doesn't work: the executionresult is created but the defect does not appear on it.
- First, I create the executionresult. Then I create the workitem and I link it to the executionresult. After that, I try to update the executionresult (via PUT request) adding the workitem to the step. But the workitem still does not appear in the executionresult.
Any clues on what could I be missing?
Accepted answer
I now have a solution that works.
- I create the defects in CCM via OSLC API.
- I create the ExecutionResult that contains each step result (without links) via QM Reportable API (only because that is how I was doing it before).
- I retrieve the ExecutionResult XML (created in 2) via QM OSLC API 2.0 (https://[IP]:9443/qm/oslc_qm/contexts/[areaId]/resources/com.ibm.rqm.execution.ExecutionResult/[executionId])
- From the XML obtained in 3, I extract the step results URLs from the <rqm_qm:containsStepResult> tags.
- I perform a GET to the ExecutionElementResult URL (obtained in 4) to those steps I want to attach a defect to (https://[IP]:9443/qm/oslc_qm/contexts/[areaId]/resources/com.ibm.rqm.execution.ExecutionElementResult/[stepResultId]) to retrieve the XML.
- In the previous XML, I add one <oslc_qm:affectedByChangeRequest> tag for each defect I want to link.
- I use the modified XML to perform a PUT to the same URL used in 5.
Now the defect appears linked to the step in the execution result.
Thank you for the support and sorry if I was approaching the problem in a wrong way from the beginning. I guess I should have only used the OSLC API but I found the Reportable API more convenient for some of the operations.
Comments
3 other answers
I am not sure what you are trying to do there and what API you refer to, but this is what a link to a work item in a ETM artifact would look like in the OSLC API (the link type could be different.):
Comments
This is a typical case of wasting time on the forum because the most basic information needed is not in the question in the first place. This is especially crucial if you ask about APIs. If you had provided an example link that you GET/POST we could have solved the mystery already.
1. Jazz products have many APIs. There are internal APIs, there are common/shared APIS such as the Jazz process
API, there are REST APIs, there are SDK's and Java or Java Script APIs.
Bookmark this page: https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding
Read that page to understand the APIs available to you.
Understand which API you are trying to use and name it in questions.
Version numbers might be important.
See https://jazz.net/forum/questions/203755/how-should-i-ask-a-question-in-the-forum-if-i-want-to-receive-useful-answers for additional suggestions.
See https://jazz.net/forum/questions/203755/how-should-i-ask-a-question-in-the-forum-if-i-want-to-receive-useful-answers for additional suggestions.
2. For RQM/ETM, in addition to the ones already mentioned there is an OSLC API and there is a REPORTABLE REST API.
As far as I can tell, just seeing the URL you try to use containing IIntegrationService in detail service/com.ibm.rqm.integration.service.IIntegrationService tells us you are trying to use the REPORTABLE REST API in the hope to be able to link the work item. In my mind the Reportable REST APIs are for reporting. They seem to support POST and PUT, but I have no examples for how that all works.
Sorry, I have not much experience with the Reportable REST API and if you can link items that way.
I was talking about the OSLC API. I know the OSLC API and you definitely can link items using that one.
Comments
showing 5 of 7
show 2 more comments
I took some time to understand the ETM/RQM Reportable REST API better. I am able to use POST and PUT to create a test case. When I copy the entry for a related work item
<ns2:relatedChangeRequest href="https://elm.example.com:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/45" rel="trackedBy" summary="45: Implement - Organizations may apply with an initial request"/>
from another test case and submit this in a PUT, I do not get a relationship between the work item and the test case.
It is absolutely possible that I can only create such a relationship from EWM, by creating a link in the work item. This would require the OSLC API.
If someone has other experience I would be interested in any insight that can be provided.
If someone has other experience I would be interested in any insight that can be provided.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER May 04 '22, 2:19 a.m.