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

Define a Test Schedule for a Test Plan Using REST API or tools such as POSTER REST Client

Assuming I have a project iteration BBB defined at the project level und its parent is iteration AAA. I can set this iteration BBB as iteration in the section Test Schedule inside Test Plan XXX manually.
Now I want to implement it automatically (z.B. using POSTER REST Client or REST API).
I can create a testphase which binds test plan XXX and iteration BBB by using a REST Client.
After sending put method to create this testphase, I got return code 201, Created successfully!
I checked the testplan XXX and the iteration BBB is also added there.
The problem now is that this iteration BBB in the testplan XXX is not what I defined before (not iteration BBB under parent iteration AAA), while it is a newly created iteration with a title BBB and its parent is also newly created with a title "TestPlanXXX". That is not what I expected. I expect to add an existing iteration BBB to an existing testplan without creating a new iteration with title BBB.

Could somebody help me? Thanks in advance!




===========old information==============
Is it possible to select an existing (parent) iteration to generate a schedule in a test plan by using RQM Rest API without creating a new one automatically?
 
In RQM Copy Utility tool

Attempt 1:
get testplan artifact and set parent iteration to it, then send put method for testplan.
Result:
No error, but it didn't work.

Attempt 2:
create a testphase object, set a destination test plan and an existing iteration, and then send put method for testphase.
Result:
Parent iteration has been added to the Test Schedule in Test Plan, but this iteration is created automatically in the Project Timelines with a name "TestPlanXXX", not the one I expected. I want to add an existing iteration which is already defined in the Project Timelines.

Thanks a lot!
Jun



0 votes



4 answers

Permanent link
Hi Jun,
It is possible to select an existing parent iteration to generate a schedule in a test plan by using REST API.

I used POSTER REST Client to do the same. And here are the steps I followed.

1) Assuming we should have a Project timelines defined and already should be part of some test plan say TP1.
2) I created a new test plan and called it TP2.
3) Did a GET using REST API client for test plan TP1 which has parent iteration already defined.
4) Did a GET using the REST API Client for the test plan TP2 which is newly created.
5) Copied the Parent iteration part from the TP1's GET data which is in the form of XML.
5) Pasted the data from step 5 into the GET data of test plan TP2.
6) Did a PUT operation for TP2 using the REST API Client. Got the status 200 OK.
7) On the WEB UI , refreshed the test plan page. Opened the test plan TP2, and under the test schedules section,
I now had the same iteration(Parent) which was defined in test plan1.

I am not quite sure what is the context of RQM Copy utility tool in the question, but using the REST API calls, the above mentioned task can be performed.

Thanks,
Krupa Gunhalkar

0 votes

Comments

Hi Krupa,

Thanks a lot for your answer! :-)
All what you mentioned I have already performed before posting this question.
What I expect is that (see your step 1)
Assuming we have a Project timeline defined, how can we put this Project timeline to a part of a test plan automatically?

Thanks,
Jun


Permanent link
Hi Jun,

Need to make couple of things clear here.

1) In my Step1
a)  I am assuming the parent timeline and iteration is defined at the project level manually.
b) I am also setting this project time line to some test plan manually.

So your question is,

1) How do we set the parent iterations to any existing or newly created test plans in a project using REST API if it is defined at the project level ?
2) What is role of Copy utility tool in your attempts? Are you trying to customize the code related to Copy Utility?
3) Are you trying to set the parent iterations of one test plan to another test plan by using copy utility ?

Thanks and Regards,
Krupa Gunhalkar

0 votes

Comments

Hi Krupa,

Thanks again!
Now I have only one question. In your step 1, assuming we defined the parent timeline and iterations at the project level manually. How can we set this timeline or iteration to an existing test plan automatically (z.B. using POSTER REST Client)?


Permanent link
Hi Jun,

Assuming we should have a Project timelines defined manually.
We can get the parent iteration from the project level using the Following process and then assign it to any test plan using REST API.

1) Open the root services URL for the server. ( Might look like : https://servername:9443/qm/rootservices )
2) From that search the URL value of the RDF reource of the project areas.
3) Once we have the Project areas, get the specific project area value.(Might look like : https://servername:9443/qm/process/project-areas/_KW4yoF64EeaINt-ul-C8qg )
4) From the specific project area, get the timelines/iterations collection value.(Might look like :  hhttps://servername:9443/qm/process/project-areas/_KW4yoF64EeaINt-ul-C8qg/timelines/_Kam1BF64EeaINt-ul-C8qg/iterations )
5) Get the Specific iteration from the iteration collections. ( Might look like : https://servername:9443/qm/process/project-areas/_KW4yoF64EeaINt-ul-C8qg/timelines/_Kam1BF64EeaINt-ul-C8qg/iterations/_h_CvzF64EeaINt-ul-C8qg )
6) Once we get the data for the exact parent iteration we want to put into the test plan, update the XML output of the already created Test Plan with this iteration information procured from step 5 and PUT this into the test plan using REST Client.

Reference : https://jazz.net/wiki/bin/view/Main/DraftTeamProcessRestApi#Iteration

Hope this helps.

Thanks and Regards,
Krupa Gunhalkar


0 votes

Comments

Hi Krupa,

Thanks again!

All you mentioned here I have already done before posing this question, it's like my Attempt 1 in the question description. I just did it by using REST API. And also I have tried it with REST Client, it didn't work.

The reason is we can't add, update or delete iteration inside a test plan. We can only do it by handling testphase. (see my Attempt 2 in the question description)


For instance, I want to create a new testphase which binds testplan A and iteration XXX (already manually defined in the project area).

predefined iteration: https://servername:9443/qm/process/project-areas/_dTTB3smVEeW6YbY2J12hw/timelines/_dWb1ZMmVEeW6YbY2J12hw/iterations/_dWb1a8mVEeW6YbY2J12hwA

I can do it by using POSTER REST Client. It worked. The iteration XXX is added to the testplan A.

But the problem now is this iteration XXX in testplan A is not what I defined before. It's newly created by the system, meanwhile the system created a new iteration named testplan A as the parent of the newly created iteration XXX.

new iteration: https://servername:9443/qm/process/project-areas/_dTTB3smVEeW6YbY2J12hw/timelines/_dWb1ZMmVEeW6YbY2J12hw/iterations/_pb4c6WXYEeai3fIqZCLo_w

How can we solve this problem?
Potential solution might be that we create a new testphase with a predefined iteration without creating a new iteration automatically by the system.
Do you know how to implement this? Or maybe you have a better idea.

Thanks a lot,
Jun
 


Permanent link
Hi Jun,

The operation of adding an existing parent iteration to a test plan works using REST Client which we both know.
Now in your case you are saying that the iteration which is getting added into a test plan is of similar title but its actually different one than the original one. Looks like a defect for me which is not reproducible on our Servers. Request you to get in touch with the support people and raise a PMR may be.

Thanks and Regards,
Krupa Gunhalkar

0 votes

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

Question asked: Jul 19 '16, 11:26 a.m.

Question was seen: 4,989 times

Last updated: Aug 23 '16, 7:00 a.m.

Confirmation Cancel Confirm