It's all about the answers!

Ask a question

REST API: Is it possible to use contains() XPath function to filter work items?

Matei Florescu (1524) | asked May 31 '15, 7:33 a.m.
Is it possible to use contains() XPath function to filter work items? Is this supported?
I would like to filter something like:

https://host:port/jazz/rpt/repository/workitem?fields=workitem/workItem[contains(summary, '..')]

Accepted answer

permanent link
Donald Nong (14.5k614) | answered May 31 '15, 10:26 p.m.
The Reportable REST API only uses a subset of the XPath 2.0, and I can't see any mention of the "contains" function in the whitepaper (in fact, it says "3.5.1 Value Comparisons" is not suppported), so I believe the contains() function is not supported. I will get a "CRRED0121E: Invalid filter condition" error if I attempt to use "contains" as a filter.

Field selection and filtering

Section 4.3 of the whitepaper document describes the field selection capability which lets you define which fields are returned in the data set. It uses a subset of XPath 2.0. This mechanism also enabled filtering capability (i.e. selecting certain fields where the value matches certain criteria). Please refer to section 4.3 for more detailed information about field selection and filtering.

Matei Florescu selected this answer as the correct answer

Matei Florescu commented Jun 01 '15, 4:23 a.m.

yes, I actually reached the same conclusion, but wanted to make sure I am correct. Thank for the answer,

Your answer

Register or 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.