It's all about the answers!

Ask a question

restrict queries from com.ibm.team.workitem.query.QueryDescriptor table


sri sudarsana (181216) | asked Aug 14 '14, 8:07 a.m.
I want to Display only epic related queries from the com.ibm.team.workitem.query.QueryDescriptor table in the report parameter.

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.

is there any parameter that i can add in for restricting the displaying queries from the table.


One answer



permanent link
Donald Nong (14.5k414) | answered Aug 15 '14, 5:09 a.m.
edited Aug 15 '14, 5:28 a.m.
If I'm not mistaken, you're talking about reports when you mention the "table". In this case, I'm afraid you're out of luck (unless someone proves me wrong).
<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 &quot;Done Tasks&quot; 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=&quot;Done+Tasks&quot;]/*
<br>
and the result is below. The &quot;work item type is task&quot; condition is highlighted, and you can see it's part of the value of attribute &lt;internalExpression&gt;. According to the reportable REST API specification, it appears that when you try to filter on an attribute, such as &lt;internalExpression&gt;, you cannot do &quot;like&quot; (sub string matching). All you can do is &quot;equal&quot;, &quot;great than&quot; and etc.
<br>
<blockquote>
    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
    <br>
    &lt;generic Version=&quot;1.0.0&quot; rel=&quot;next&quot; href=&quot;https://clm:9443/ccm/rpt/repository/generic?fields=generic%2Fcom.ibm.team.workitem.query.QueryDescriptor%5Bname%3D%22Done%20Tasks%22%5D%2F*&amp;id=_B_VcgCRYEeS27JEFFlkqmw&amp;size=100&amp;pos=100&quot;&gt;
    <br>
    &nbsp;&lt;com.ibm.team.workitem.query.QueryDescriptor&gt;
    <br>
    &lt;name&gt;Done Tasks&lt;/name&gt;
    <br>
    &lt;uniqueId&gt;0f2449091ff66e27df9d42f85a32ddf2&lt;/uniqueId&gt;
    <br>
    &lt;reportableUrl&gt;https://clm:9443/ccm/rpt/repository/generic/com.ibm.team.workitem.query.QueryDescriptor/itemId/_AV_CsGLBEeOj4c1n9GOJ3Q&lt;/reportableUrl&gt;
    <br>
    &lt;itemType&gt;com.ibm.team.workitem.query.QueryDescriptor&lt;/itemType&gt;
    <br>
    &lt;stateId&gt;_AXW7t2LBEeOj4c1n9GOJ3Q&lt;/stateId&gt;
    <br>
    &lt;itemId&gt;_AV_CsGLBEeOj4c1n9GOJ3Q&lt;/itemId&gt;
    <br>
    &lt;contextId&gt;__yFrcGLAEeOj4c1n9GOJ3Q&lt;/contextId&gt;
    <br>
    &lt;modified&gt;2013-12-12T11:04:44.395+1100&lt;/modified&gt;
    <br>
    &lt;mergePredecessor /&gt;
    <br>
    &lt;predecessor /&gt;
    <br>
    &lt;description /&gt;
    <br>
    <b>&lt;internalExpression&gt;</b>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;query&gt;&lt; select /&gt;&lt;where&gt;&lt;and&gt;&lt;condition operator=&quot;is&quot;&gt;&lt;attribute name=&quot;projectArea&quot;/&gt;&lt;value content=&quot;__yFrcGLAEeOj4c1n9GOJ3Q&quot; type=&quot;projectArea&quot;/&gt;&lt;/condition&gt;&lt;and&gt;&lt;or&gt;<b>&lt;condition operator=&quot;is&quot;&gt;&lt;attribute name=&quot;workItemType&quot;/&gt;&lt;value content=&quot;task&quot; type=&quot;type&quot;/&gt;&lt;/condition&gt;</b>&lt;/or&gt;&lt;or&gt;&lt;condition operator=&quot;is&quot;&gt;&lt;attribute name=&quot;internalState&quot;/&gt;&lt;variable arguments=&quot;closed&quot; type=&quot;state&quot;/&gt;&lt;/condition&gt;&lt;/or&gt;&lt;/and&gt;&lt;/and&gt;&lt;/where&gt;&lt;/query&gt;<b>&lt;/internalExpression&gt; </b>
    <br>
    &lt;serializationVersion&gt;XML&lt;/serializationVersion&gt;
    <br>
    &lt;queryType&gt;com.ibm.team.workitem.workItemType&lt;/queryType&gt;
    <br>
    &lt;tags /&gt;
    <br>
    &lt;id&gt;com.ibm.team.workitem.queries.predefined.doneTasks&lt;/id&gt;
    <br>
    &lt;internalHasParameters&gt;false&lt;/internalHasParameters&gt;
    <br>
    &lt;modifiedBy /&gt;
    <br>
    &lt;projectArea /&gt;
    <br>
    &lt;creator /&gt;
    <br>
    &lt;internalAssociations /&gt;
    <br>
    &lt;itemHistory /&gt;
    <br>
    &nbsp;&lt;/com.ibm.team.workitem.query.QueryDescriptor&gt;
    <br>
    &lt;/generic&gt;
</blockquote>


Comments
sri sudarsana commented Aug 18 '14, 5:45 a.m.

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?


Donald Nong commented Aug 18 '14, 9:50 p.m.

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.

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.