Looking for example of Category creation using REST API
Hi.
I need to create parent/child category types and values for test cases. Some of the child category types have hundreds of values. I have RQMUrlUtility 3.0.1 and have been able to use it to retrieve test plan and test case information. I have also looked over the RQMUrlUtility documentation and XML Schema Documentation but the latter in particular is overwhelming and pretty meaningless to me. Questions: 1. How do I GET and PUT test case category types, dependencies, terms and values? Scope needs to be specified but the RQMUrlUtility documentation and examples don't help me. 2. I've seen mention of RQMUrlUtility source but can't find it. Where can I download it please? Thanks. |
31 answers
The RQM URL Utility is based on the RQM Reportable REST API (https://jazz.net/wiki/bin/view/Main/RqmApi). We have recently added a section to assist people in learning the API (see https://jazz.net/wiki/bin/view/Main/RqmApi#Common_Usage_Scenarios). In your case, you are GETting/PUTting category/categoryType resources (https://jazz.net/wiki/bin/view/Main/RqmApi#Resources_and_their_Supported_Op).
See https://jazz.net/wiki/bin/view/Main/RQMURLUtility#Accessing_the_Source (new). |
I have a similar question and have been successful in creating my own XML to import cases. However, a specific example showing the XML construct for a category would be helpful. I could extend this to other testcase type functions such as "weight" as well.
For example, the title construct is easy enough, i.e., <dc>My Test Case 2 Title</dc> and the case description is more complicated, i.e., <myns>This is test case #2 content description </myns> but I do not want to guess on how to structure the testcase.category equivalent string in my XML file. I hope this helps explain what I could use? |
I have a similar question and have been successful in creating my own XML to import cases. However, a specific example showing the XML construct for a category would be helpful. I could extend this to other testcase type functions such as "weight" as well. The editor chopped off the rest of the myns string above!! |
As mentioned, there is a tip (https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip) in the referenced WIKI on how to determine the structure of the XML. In addition, you can use the schema:
https://jazz.net/wiki/bin/view/Main/RqmApi#Detailed_Schema_Documentation |
As mentioned, there is a tip (https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip) in the referenced WIKI on how to determine the structure of the XML. In addition, you can use the schema: Thank you Paul. I was hoping for a specific description that could be applied (without having to dig too much into the REST API structures). However, it seems like reading the schema for an existing structure and editing it is "reverse engineering" but if that's the preferred method (to expedite our needs), I'm OK with that. |
The description is in the RQM XML schema documentation but the 'reverse engineering' approach (GETting example resource XML) is preferred by most.
|
As mentioned, there is a tip (https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip) in the referenced WIKI on how to determine the structure of the XML. In addition, you can use the schema: Paul, I used your method to discover the category and weight terms in the GET data. When I used my previous PUT XML and added the category/weight, they were ignored inside RQM. The requested Functions are already in the RQM category list. Here is my XML file (hopefully usable). The test case content DID PUT correctly. Thanks for your help! W. <xml> <testcase> <myns>This is test case #2 content description </myns> <dc>Test Case 2 Title</dc> <myns>Moon must exist</myns> <myns>Moon must still exist</myns> <dc>Test Case 2 Description</dc> <jzalm>wayne</jzalm> <weight>1500</weight> <category> <category> <variables> </testcase> |
As mentioned, there is a tip (https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip) in the referenced WIKI on how to determine the structure of the XML. In addition, you can use the schema: Paul, I used your method to discover the category and weight terms in the GET data. When I used my previous PUT XML and added the category/weight, they were ignored inside RQM. The requested Functions are already in the RQM category list. Here is my XML file (hopefully usable). The test case content DID PUT correctly. Thanks for your help! W. <xml> <testcase> <myns>This is test case #2 content description </myns> <dc>Test Case 2 Title</dc> <myns>Moon must exist</myns> <myns>Moon must still exist</myns> <dc>Test Case 2 Description</dc> <jzalm>wayne</jzalm> <weight>1500</weight> <category> <category> <variables> </testcase> The XML data gets removed in the postings. I'm very sorry. I can email the info rto you separately as needed. |
As mentioned, there is a tip (https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip) in the referenced WIKI on how to determine the structure of the XML. In addition, you can use the schema: Paul, I used your method to discover the category and weight terms in the GET data. When I used my previous PUT XML and added the category/weight, they were ignored inside RQM. The requested Functions are already in the RQM category list. Here is my XML file (hopefully usable). The test case content DID PUT correctly. Thanks for your help! W. <xml> <testcase> <myns>This is test case #2 content description </myns> <dc>Test Case 2 Title</dc> <myns>Moon must exist</myns> <myns>Moon must still exist</myns> <dc>Test Case 2 Description</dc> <jzalm>wayne</jzalm> <weight>1500</weight> <category> <category> <variables> </testcase> The XML data gets removed in the postings. I'm very sorry. I can email the info rto you separately as needed. Here is data with HTML turned off: <?xml version="1.0" encoding="utf-8"?> <testcase xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:jzalm="http://jazz.net/xmlns/alm/v0.1/" xmlns:alm="http://jazz.net/xmlns/alm/v0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:myns="http://mydomain.net/some/custom/namespace/v0.1/" xmlns:ts="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:er="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:vg="http://schema.ibm.com/vega/2008/" xmlns:rs="http://jazz.net/xmlns/alm/qm/remotescript/v0.1/"> <myns:com.ibm.rqm.planning.editor.section.testCaseDesign extensionDisplayName="RQM-KEY-TC-DESIGN-TITLE">This is test case #2 content description </myns:com.ibm.rqm.planning.editor.section.testCaseDesign> <dc:title>Test Case 2 Title</dc:title> <myns:com.ibm.rqm.planning.editor.section.testCasePreCondition extensionDisplayName="RQM-KEY-TC-PRE-COND-TITLE">Moon must exist</myns:com.ibm.rqm.planning.editor.section.testCasePreCondition> <myns:com.ibm.rqm.planning.editor.section.testCasePostCondition extensionDisplayName="RQM-KEY-TC-POST-COND-TITLE">Moon must still exist</myns:com.ibm.rqm.planning.editor.section.testCasePostCondition> <dc:description>Test Case 2 Description</dc:description> <jzalm:owner>wayne</jzalm:owner> <weight>1500</weight> <category term="Function" value="FunctionTwo" /> <category term="Test Phase" value="Performance & Service Level Test" /> <variables /> </testcase> |
As mentioned, there is a tip (https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip) in the referenced WIKI on how to determine the structure of the XML. In addition, you can use the schema: Paul, I used your method to discover the category and weight terms in the GET data. When I used my previous PUT XML and added the category/weight, they were ignored inside RQM. The requested Functions are already in the RQM category list. Here is my XML file (hopefully usable). The test case content DID PUT correctly. Thanks for your help! W. <xml> <testcase> <myns>This is test case #2 content description </myns> <dc>Test Case 2 Title</dc> <myns>Moon must exist</myns> <myns>Moon must still exist</myns> <dc>Test Case 2 Description</dc> <jzalm>wayne</jzalm> <weight>1500</weight> <category> <category> <variables> </testcase> The XML data gets removed in the postings. I'm very sorry. I can email the info rto you separately as needed. Here is data with HTML turned off: <?xml version="1.0" encoding="utf-8"?> <testcase xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:jzalm="http://jazz.net/xmlns/alm/v0.1/" xmlns:alm="http://jazz.net/xmlns/alm/v0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:myns="http://mydomain.net/some/custom/namespace/v0.1/" xmlns:ts="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:er="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:vg="http://schema.ibm.com/vega/2008/" xmlns:rs="http://jazz.net/xmlns/alm/qm/remotescript/v0.1/"> <myns:com.ibm.rqm.planning.editor.section.testCaseDesign extensionDisplayName="RQM-KEY-TC-DESIGN-TITLE">This is test case #2 content description </myns:com.ibm.rqm.planning.editor.section.testCaseDesign> <dc:title>Test Case 2 Title</dc:title> <myns:com.ibm.rqm.planning.editor.section.testCasePreCondition extensionDisplayName="RQM-KEY-TC-PRE-COND-TITLE">Moon must exist</myns:com.ibm.rqm.planning.editor.section.testCasePreCondition> <myns:com.ibm.rqm.planning.editor.section.testCasePostCondition extensionDisplayName="RQM-KEY-TC-POST-COND-TITLE">Moon must still exist</myns:com.ibm.rqm.planning.editor.section.testCasePostCondition> <dc:description>Test Case 2 Description</dc:description> <jzalm:owner>wayne</jzalm:owner> <weight>1500</weight> <category term="Function" value="FunctionTwo" /> <category term="Test Phase" value="Performance & Service Level Test" /> <variables /> </testcase> When the "category" lines were removed, the RQmUrlUtility got a 200 response and was successful. The weight parm went through OK. When the category parms were included, RQmUrlUtility complained with a 400 code. Thx. |
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.