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

How to clear Build field in RQM's Test Case Result using REST API?

One of the features of my application requires being able to clear "Build" in the Test Case Result record via REST API. The problem is that I can set the build or change the build to another valid build record, but I have not been able to clear the build record.  The server's version is 6.0.

When I first create the test case result, its xml does not have <buildId> or <buildrecord> elements, and the Build field on the RQM client's web page is shown as "Unassigned". From this point on, I am using HttpRequester (Firefox plugin) to check the workings of the REST API, so that we can remove my applications from the picture.

- When I GET executionresult:id from the server for the test case, I can confirm that its xml does not have those two build-related elements.

- I then modify the xml to insert buildid and buildrecord elements for the existing build, and PUT or POST that back to the server. The client properly shows the build that I meant to set.

- I then do GET again, modify the xml to remove buildid and buildrecord, and submit the result again to the server. However, the original build is still shown. The server ignored the fact that the new xml that I am submitting does not have build associated with it. (When I do GET again, I can also see both build-related elements, so that was not just a client refresh issue.)

- Yet the build can be cleared manually in the client. Pressing the Clear button next to Build, properly changes it to Unassigned, and the test case's xml no longer includes the build.

- I also tried the following:
(a) If instead of removing the build elements from the xml I use those for a different build, the server does apply the change.
(b) If in href of buildrecord I put a url that does not refer to a build record (like https://www.google.com") or even make it href="", it has no affect. The server returns success and does not change anything.
(c) If I do not use any attributes in buildrecord, I am getting an error from the server (which is correct, since href is a required attribute).
(d) I also tried setting <buildid> to 0, to no effect.

Thus, the server allows changing the build record of the test case result to another valid build record, but does not allow clearing the build via REST API.

Does anybody know how I can clear the build field in test case result via REST API?

0 votes



One answer

Permanent link
I just took a look at the code.  From what I see, it looks like the behavior you see is what the author intended.  The reason is because PUT can be used to do a partial update of an item.  For instance, if you just wanted to change the name of an item you would only need to PUT the dc:title element.  If you were to do that and QM subsequently cleared the description because your XML did not include a dc:description, that'd be unexpected from the client's perspective.

I looked around for a way to clear the build ID, but I'm not seeing one.  I'll keep searching, but in the mean time, if this is something you require, I'd recommend opening an enhancement request so that it gets proper visibility during our planning process.

0 votes

Comments

 Michael, thank you for looking into this. I will think about submitting an enhancement request. Please let me know if you do find a workaround. 

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
× 563
× 137

Question asked: Jun 27 '16, 3:44 p.m.

Question was seen: 3,692 times

Last updated: Jul 12 '16, 9:59 a.m.

Confirmation Cancel Confirm