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.
|
Hi Daniel / Eric,
not sure what I'm doing wrong.... I'm using an existing query and try to select a number of value IDs.... I always get the following error: Error: com.ibm.team.repository.web.transport.ServiceRequest(): invalid requestParameters parameter: [object Object] The request I'm using: https://swgjazz.ibm.com:8052/jazz/web/projects/Business%20Process%20Manager #action=com.ibm.team.workitem.runSavedQuery&id=_G5Pj8GTqEeW_a_znQFYvCQ&filterAttribute=id&jsonParameterValues={"id2":{"attributeId":"id","operator":"is","values":[200009,200010],"variables":[]}}&maxResults=50&projectAreaItemId=_xNY7cMzrEeCeP-edQ3dTlQ&startIndex=0 Any suggestion appreciated. Thx. Comments
Donald Nong
commented Oct 01 '15, 9:59 p.m.
Why does the jsonParameterValues contain a "null" value ("variables": [])?
Guenther Jornitz
commented Oct 02 '15, 2:15 a.m.
Good point... I copied it from what I captured w/ firebug in another case.....
|
Not sure whether I should put it as an answer or a comment somewhere, but here it goes.
|
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.