restrict queries from com.ibm.team.workitem.query.QueryDescriptor table
Say suppose there are 5 queries in the table and out of which 3 are involved with epics and 2 are involved with other other workitems.
One answer
<br>
You use reportable REST API to generate the data source in your reports, and for the particular filter that you want (work item type is task), it is buried in the attribute value and can't be used in filtering. Take the built-in query "Done Tasks" in the JKE Banking sample project, you can get its data by accessing
<br>
https://clm:9443/ccm/rpt/repository/generic?fields=generic/com.ibm.team.workitem.query.QueryDescriptor[name="Done+Tasks"]/*
<br>
and the result is below. The "work item type is task" condition is highlighted, and you can see it's part of the value of attribute <internalExpression>. According to the reportable REST API specification, it appears that when you try to filter on an attribute, such as <internalExpression>, you cannot do "like" (sub string matching). All you can do is "equal", "great than" and etc.
<br>
<blockquote>
<?xml version="1.0" encoding="UTF-8" ?>
<br>
<generic Version="1.0.0" rel="next" href="https://clm:9443/ccm/rpt/repository/generic?fields=generic%2Fcom.ibm.team.workitem.query.QueryDescriptor%5Bname%3D%22Done%20Tasks%22%5D%2F*&id=_B_VcgCRYEeS27JEFFlkqmw&size=100&pos=100">
<br>
<com.ibm.team.workitem.query.QueryDescriptor>
<br>
<name>Done Tasks</name>
<br>
<uniqueId>0f2449091ff66e27df9d42f85a32ddf2</uniqueId>
<br>
<reportableUrl>https://clm:9443/ccm/rpt/repository/generic/com.ibm.team.workitem.query.QueryDescriptor/itemId/_AV_CsGLBEeOj4c1n9GOJ3Q</reportableUrl>
<br>
<itemType>com.ibm.team.workitem.query.QueryDescriptor</itemType>
<br>
<stateId>_AXW7t2LBEeOj4c1n9GOJ3Q</stateId>
<br>
<itemId>_AV_CsGLBEeOj4c1n9GOJ3Q</itemId>
<br>
<contextId>__yFrcGLAEeOj4c1n9GOJ3Q</contextId>
<br>
<modified>2013-12-12T11:04:44.395+1100</modified>
<br>
<mergePredecessor />
<br>
<predecessor />
<br>
<description />
<br>
<b><internalExpression></b><?xml version="1.0" encoding="UTF-8"?><query>< select /><where><and><condition operator="is"><attribute name="projectArea"/><value content="__yFrcGLAEeOj4c1n9GOJ3Q" type="projectArea"/></condition><and><or><b><condition operator="is"><attribute name="workItemType"/><value content="task" type="type"/></condition></b></or><or><condition operator="is"><attribute name="internalState"/><variable arguments="closed" type="state"/></condition></or></and></and></where></query><b></internalExpression> </b>
<br>
<serializationVersion>XML</serializationVersion>
<br>
<queryType>com.ibm.team.workitem.workItemType</queryType>
<br>
<tags />
<br>
<id>com.ibm.team.workitem.queries.predefined.doneTasks</id>
<br>
<internalHasParameters>false</internalHasParameters>
<br>
<modifiedBy />
<br>
<projectArea />
<br>
<creator />
<br>
<internalAssociations />
<br>
<itemHistory />
<br>
</com.ibm.team.workitem.query.QueryDescriptor>
<br>
</generic>
</blockquote>
Comments
Actually we have a report wherein one of the report parameter shows all the shared queries in that particular project area. (This data is fetched from com.ibm.team.workitem.query.QueryDescriptor table ).I would like to restrict the queries which are related only to Epics.Say ,there are 5 shared queries.Among which if 2 gets executed,it will give epic workitems as the output,1 will give all the workitems (Epic,Defect,Task,etc) as output and 2 will give defect workitems as output. Here i need to account only the epic related queries (2+1) and not the last 2 defect related queries.Is there a way that i can achieve this?
Not really familiar with reporting, but if you can execute the queries on condition, simply check the <internalExpression> attribute before execute the said query. For example, only when the attribute contain the below string will you execute the query.
<condition operator="is"><attribute name="workItemType"/><value content="epic" type="type"/></condition>You may have to experiment a bit to get the right result though.