MultivalueFilter is not working

Thursday, March 24, 2016 11:39:23 AM
Hi,

I am trying to filter test runs based on some test set ids. I have created a multivalue filter for that based on some examples I found in the internet.But while retrieving, this filter is not working. Single value filter is working fine.I have pasted the code for multivalue filter below :

<code>
      List<RemoteFilter> remoteFilters = new ArrayList<RemoteFilter>();
      RemoteFilter remoteFilter = new RemoteFilter();
      MultiValueFilter multiFilter = new MultiValueFilter();
      multiFilter.setIsNone(false);
      multiFilter.setValues(new int[] {59313,59323});
      remoteFilter.setPropertyName("TestSetId");
      remoteFilter.setMultiValue(multiFilter);
      remoteFilters.add(remoteFilter);
      RemoteFilter remoteFilterArray[] = new RemoteFilter[remoteFilters.size()];
      RemoteTestRun[] nextChunk = spira.testRun_Retrieve(remoteFilterArray, new RemoteSort(), rowNum, chunkSize); 
</code>

If you find anything wrong with the code or anything I am doing wrong then let me know.

Thanks.

5 Replies
Friday, March 25, 2016 1:30:28 PM
Avatar
re: abanerjee on Thursday, March 24, 2016 11:39:23 AM
Hi Abhijit

For the TestSetId field I would instead use the IntValue filter:

      List<RemoteFilter> remoteFilters = new ArrayList<RemoteFilter>();
      RemoteFilter remoteFilter = new RemoteFilter();
      remoteFilter.setPropertyName("TestSetId");
      remoteFilter.setIntValue(59313);
      remoteFilters.add(remoteFilter);
      RemoteFilter remoteFilterArray[] = new RemoteFilter[remoteFilters.size()];
      RemoteTestRun[] nextChunk = spira.testRun_Retrieve(remoteFilterArray, new RemoteSort(), rowNum, chunkSize); 

Regards
Sarah
Friday, March 25, 2016 3:42:17 PM
Avatar
re: inflectra.sarahx on Friday, March 25, 2016
Hi Sarah,

Thanks for your reply. 
So if there is multiple test set ids then what I am supposed to do. One way is to loop through the TestSetIds and then retrieve the test cases using single value filter. 
But I just wanted to know whether multi value filter is not working me only or it is not working for everyone or am I missing something. I'll be very glad if someone can guide me through.

Thanks,
Abhijit 
Friday, March 25, 2016 5:58:59 PM
Avatar
re: abanerjee on Friday, March 25, 2016
Hi Abhijit

For the test set field you cannot use a multi-value filter I'm afraid, you'd have to loop and query for each one and then aggregate the results.

Regards
Adam
Tuesday, March 29, 2016 5:42:57 AM
Avatar
re: inflectra.adam on Friday, March 25, 2016
Hi Adam,

It's not just Test Set Ids , for Test Case Ids also it is not working. The project I am working on is pretty big , so calling web service more than once is not feasible in terms of cost.
I guess there is some issue with this MultiValue Filter. If you can check and fix it then it'll be very helpful.

Thanks,
Abhijit
Tuesday, March 29, 2016 1:37:44 PM
Avatar
re: abanerjee on Tuesday, March 29, 2016
Hi Abhijit

We have logged it in our enhancement tracker, and it will added in the future. However I do not have a definite timeline.

Regards

Adam
Statistics
  • Started: Thursday, March 24, 2016 11:39:23 AM
  • Last Reply: Tuesday, March 29, 2016 1:37:44 PM
  • Replies: 5
  • Views: 648