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.
<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>
- 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.
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.
Comments
Thanks for sharing.
PS: I am not able to create the link in the work item by saving a test case using the reportable REST API. My assumption is, that the link need to be created in EWM in that case.
Note that https://jazz.net/wiki/bin/view/Main/RqmApi#Notable_changes_from_ETM_7_0_1_t mentioned the API change for work item and advertises to use the ETM OSLC API for work item linking.
3 other answers
Comments
Yes sorry I am talking about the OSLC API. I am attaching a Jazz web interface screenshot of what I am trying to replicate via OSLC API.
I can't see the images. Try to use Chrome to attach them. Please edit your comment.
Updated. Images should be visible now
Your linked work item is a PROPERTY of the enclosed test step and not a LINK to the execution result you are saving. I am not sure if there is a way to modify the step result. I would try to have a link on the executionresult level first, before becoming adventurous.
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.
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.
Comments
https://jazz.net/forum/questions/279587/how-to-create-test-result-via-reportable-rest-api-oslc-api-in-etm might be a good place to start about this. I am not sure. There might be other examples if you google for RQM reportable rest API RQM site:jazz.net and maybe throw PUT or POST into the first part of the search string.
PS: Only RQM allows to create/update anything using the reportable REST API, all other applications only allow it for getting information.
Maybe using the RQM URL Util provides better feedback. Not sure.
Sorry for the lack of clarity and wasting of time! Thanks for the information links.
P.S.: The creation of the executionresult works OK with the Reportable REST API, but I'm only missing the defect linking. I will be making more tests to see if I manage to do it.
The ETM reportable RESt API is an API for ETM. You assume that it handles changes in links to the other applications. It is not clear if this assumption is valid and, especially, if the backlinks in the remote applications are created if necessary.
The OSLC format links the step result to the execution result with the containsStepResult tag. It should be possible to link an ExecutionElementResult to the defect with its affectedByChangeRequest tag. I am trying that the next.
To make this absolutely clear once and for all, there is no OSLC and no OSLC related format, information or anything else to be seen in this whole post.
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
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.Nothing in the XML above looks like anything I would expect in RDF+XML which is the supported format for OSLC.