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

RqmApi - Filtering testcases by custom attribute

 CLM 4.0.4

I am trying to use rest API to GET all test cases filtered by specific custom attribute. For the sake of this example, lets name it 'myattribute'. The applicable values are A,B or C. I want to filter all testcases where myatrribute is A or B.
My initial trial is:

https://<RQMServer>:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<ProjectArea>/testcase?fields=feed/entry/content/testcase/*

The documentation is somewhat unclear. 

Please advice,
Liora



0 votes


Accepted answer

Permanent link
The filter you need is
/testcase?fields=feed/entry/content/testcase[customAttributes/customAttribute/name="myattribute" and (customAttributes/customAttribute/value="A" or customAttributes/customAttribute/value="B")]/*

Liora Milbaum selected this answer as the correct answer

1 vote

Comments

Thanks Donald. 


2 other answers

Permanent link
 Another question, how do I filter test cases with an unassigned category?

Liora

0 votes

Comments

I'm not positive that you can do that. When a category is "unassigned", it simply does not exist in the test case. So a filter to check the "unassigned category" is actually check the existence of the "category" property. It will make it more difficult if there are multiple categories defined but only some of them are assigned values for the test case.

1 vote

Right. I have been trying to figure this out for hours.

More then that, it is impossible to use REST API to filter more than two categories. 
Eventuality, I have  created a filter in the WEB UI, added a new category with values: true/false, marked the outcome test cases with the value true... and this is it.
Now I have REST API filter with one category and one value.

Thanks again


Permanent link
In this example query, the result would return the testcase also, if another attribute, lets say 'myAttribute2', would have the value "A" or "B" but "myAttribute" doesn't.

It seems like it doesn't matter if the value "A" or "B" is assigned to "myAttribute" or "myAttribute2".

Is there any possibility to get the result if and only if "A" or "B" is assigned to "myAttribute"?

0 votes

Comments

Hi Julian, good catch! Sorry I don't have a solution for this. I wish the below filter would work, but unfortunately only the first bit name="mycustomattribute" is recognized. Basically I cannot find a way to tie both "name" and "value" to the same parent.
?fields=feed/entry/content/testcase[customAttributes/customAttribute[name="mycustomattribute" and value="BBB"]]/*

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
× 10,953

Question asked: Oct 02 '14, 1:26 p.m.

Question was seen: 4,480 times

Last updated: Apr 26 '16, 8:55 p.m.

Related questions
Confirmation Cancel Confirm