It's all about the answers!

Ask a question

How to change/update TeamArea value in RQM to an existing test artifact(especially for test script) with rest api. (python)


durga sankar (137) | asked Jun 21 '21, 3:17 a.m.
edited Jun 22 '21, 9:05 a.m.

 hello respective,

        i am trying to change or update team area value for an existing test artifact. i created through POST method. initially i provided team area value (while creating). Then i again execute my script to update the test artifact. But for second time i provided different team area value. when i check in the rqm team area value was the same while the creation time i provided. it didn't update the second value.

Ex.
Input: team area value given while creation for test artifact: "abc"
Output: team area value in newly created test artifact : "abc"

2nd time execution,

input: team area value given to update the existing test artifact: "qwe"
output: team area value after update the existing test artifact: "abc"

but description, attributes, categories, sections, etc. everything are updating.

2 answers



permanent link
Ralph Schoon (63.1k33645) | answered Jun 21 '21, 4:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

See https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding for links to OSLC related information and the defined APIs.


 I assume you use the OSLC API. In this case you would GET the artifact. In the response body, you would replace the URI of the team area with the URI of the desired team area. The information is PUT to the artifact URI. Note that you send the etag you received in the previous operation (e.g. GET) in an 'If-Match' header. This would look like If-Match "be0c8678-d77d-3c51-8dbb-f4dbee6dc075" for etag "be0c8678-d77d-3c51-8dbb-f4dbee6dc075"

Note, POST is the create artifact operation.


Comments
durga sankar commented Jun 21 '21, 8:05 a.m.

Hey Ralph,

 Thank you for the comment, actually i'm using POST only for if artifact not present in the QM. for updating i am using PUT. 
  XML body which is i am pushing to server there the URI is properly updated. but in the server it's not reflecting after update. Description and all other things are updating. but not only the team-area. especially for test script. test case and suite are updating


Ralph Schoon commented Jun 21 '21, 8:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

There is no actionable information in your comment. If you are unwilling or unable to provide the URI's and headers, there is nothing I can do. Have you been able to change the team area manually? What was the effect in the XML if you only did that? Is that what you are providing?


durga sankar commented Jun 21 '21, 10:17 a.m. | edited Jun 21 '21, 10:17 a.m.
i did change manually it's working fine, while i am doing with REST PUT method, only the test script team area is not updating. description, etc. are updating.

in test case and suite team area value is updating.
headers = {'Content-Type':'text/xml','X-Jazz-CSRF-Prevent':jessionid} 

there is an existing test script. i just want to update the team area, with new value. while creating with post i provided the team area value, it was creating test script and assigning the given team area. But then i want new value to give and update, on that time new value not updating. it's same as old value. i am new to this. do not know what to provide you correctly also. i'm sorry for foolishness.


Ralph Schoon commented Jun 21 '21, 10:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This is more information. As far as I can tell, that API is NOT an OSLC API. I do not know that API and can not help with it. I would try to only change the team area and compare the before and the answer. Maybe there is something missing. You could share that information here. 


durga sankar commented Jun 21 '21, 11:02 a.m.

this is rest api actually, my exact point is, if test case and test suit are updating with updated value then why test script only not taking the updated value, and description and other things are updating but not the team area, even i am providing the correct value. 


Ralph Schoon commented Jun 21 '21, 11:31 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This might help: https://jazz.net/wiki/bin/view/Main/RqmApi . I do not know why you see what you see. I would assume that if you PUT the changed correct data, then it should work. But I know that this is sometimes not true. I would set the team area in the UI to Team1 and GET the data. Then I would set the team area Team 2 and then get the data. Then I would send the response body of the first GET and see if the change happens. If not, there might be a defect or something is not supported.

 


durga sankar commented Jun 21 '21, 12:13 p.m.

ok, sure. meanwhile i will check in some other way and let you know. 


Ralph Schoon commented Jun 21 '21, 1:23 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Sure, why follow the sensible way, try something else.


durga sankar commented Jul 02 '21, 12:27 a.m.

hello Ralph, did you get any way out in this !!! i didn't get any success for updating existing testscript team area. 


Ralph Schoon commented Jul 02 '21, 2:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The API you are trying to use is not a public API as far as I can tell. You can try to look into the API Landing Page and try to follow the OSLC API. I do not have the time any more to provide advice that is not followed anyway. 

showing 5 of 10 show 5 more comments

permanent link
Steven Wallace (336) | answered Jun 22 '21, 8:38 a.m.

I've found that some values will not take when you attempt to update them using the RqmApi, but do work when being updated via OSLC. Seems odd that you would need to perform two GET (one RqmApi, one OSLC) and two PUT (one RqmApi, one OSLC) but this has worked for me in the past.


Comments
durga sankar commented Jun 22 '21, 8:57 a.m.

thank you Steven, for sharing your experience, i will definitely give a shot to it.  


durga sankar commented Jun 23 '21, 2:17 a.m. | edited Jun 23 '21, 2:17 a.m.

Thank you Steven for suggestion, but i cannot perform this operation, because there are thousands of test scripts, so i think server can behave unexpected. 

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.