Filtering workitems from saved query using GET, filterAttribute and filterValue parameters
![]()
Good morning.
My company is trying to merge some web applications, and one of the requisites is to be able to retrieve workitems with some custom filters, like type, internalState or relation with other workitems. To do so, we must provide an URL to RTC, so I'm planning to use a custom saved query which returns all the workitems by default. Then, I use the parameters "filterAttribute" and "filterValue" to get the elements I'm looking for, in the following way:
Workitem with ID = 139:
Workitems with "defect" type:
Workitems related with workitem which ID is 139:
I achieved applying these filters using filterAttribute and filterValue parameters, but just one by one (One request, one filter). Does anyone know if there's a way to combine the filters in just one request using GET instead POST method allowing to perform "AND" operations over the saved query?
Thank you very much for your help.
Kind regards,
Daniel G. Garcia.
|
6 answers
![]()
Hello Daniel,
you may use jsonParameterValues
Sample syntax:
&filterAttribute=<some_attribute_id>
&filterValue=<some_value>
&jsonParameterValues=
"resolutionDate":{"attributeId":"resolutionDate","operator":"after","values":["1388595600000"],
"internalState":{"attributeId":"internalState","operator":"is","values":["workflow.state.s5","workflow.state.s6"],
}
Hope it helps,
Eric
|
![]()
Hi, Eric,
First of all, thanks for answering. As far as I know, jsonParameterValues can only be sent through HTTP PUT/POST request. Unfortunately, I am only allowed to send a HTTP GET request. Do you know if there is any way to send jsonParameterValues using this method?
Again, thanks for your help.
Kind regards,
Daniel.
|
![]()
Hello Daniel,
well - when you run a query from a RTC Dashboard Work Item Statistics Viewlet,
we do a GET:
to which we pass filterAttribute, filterValue and jsonParameterValues:
you may give it a try and check the request using Chrome and debugging tools.
Hope it helps,
Eric
|
![]()
Hi, Eric,
I'll take a look, thank you very much for your help.
Daniel.
|
![]() Not sure whether I should put it as an answer or a comment somewhere, but here it goes.
|