It's all about the answers!

Ask a question

How to get results for itemHistory via the REST API

Mike Shkolnik (9657150143) | asked Nov 05 '14, 2:07 p.m.
Is it possible to specify a parameter that would return work items with HISTORY containing any elements that match the criteria? For example:

https://SERVER:PORT/jazz/rpt/repository/workitem?fields=workitem/workItem[type/id="task" and itemHistory/timeSpent="3600000"]/*

returns the error:

"CRRED0135E: Illegal filter. The field 'workitem/itemHistory/timeSpent' may not be used in a filter because it returns multiple values."

because there are multiple entries for itemHistory/timeSpent. Is there a way to specify work items in which ANY itemHistory/timeSpent matches the parameter, and what is the syntax for that?

One answer

permanent link
Donald Nong (14.4k213) | answered Nov 05 '14, 9:57 p.m.
I suggest you filter the item history directly since it is "flat" here for the intended filters. So it looks like
https://SERVER:PORT/jazz/rpt/repository/workitem?fields=workitem/workItem/itemHistory[type/id="task" and timeSpent=3600000]/*
It may not meet your requirement perfectly since some fields that you want may not be in the item history, and you may get duplicate copies of the work item itself.

Your answer

Register or to post your answer.