Make item on wiki classic report to not show up

Description
fmanchester
Posts: 1
Joined: Wed Oct 14, 2015 6:43 pm

Make item on wiki classic report to not show up

Postby fmanchester » Wed Oct 14, 2015 6:49 pm

I am querying workitems and displaying them in a report. I want nothing to show up if there are no workitems in the query. Like some sort of if statement that if it is false the code will not be displayed. Is this possible?

My code is:

{regiontitle}
Aviation Statistics Module
{regiontitle}

{workitems: sqlQuery=
select
WORKITEM.C_URI
from
WORKITEM
inner join PROJECT on WORKITEM.FK_URI_PROJECT = PROJECT.C_URI
inner join CF_WORKITEM RELEASE on RELEASE.FK_WORKITEM = WORKITEM.C_PK
inner join CF_WORKITEM MODULE on MODULE.FK_WORKITEM = WORKITEM.C_PK
inner join CF_WORKITEM SCREEN on SCREEN.FK_WORKITEM = WORKITEM.C_PK
where
PROJECT.C_ID = 'PROPworks'
and (WORKITEM.C_TYPE = 'enhancementrequest' or WORKITEM.C_TYPE= 'bug')
and RELEASE.C_NAME = 'targetRelease'
and RELEASE.C_STRING_VALUE = '$targetPROPworksVersion'
and MODULE.C_NAME = 'airitModule'
and MODULE.C_STRING_VALUE = 'bAvStats'
and SCREEN.C_NAME = 'screenId'
order by SCREEN.C_STRING_VALUE desc | fields=type, releaseNotes, novoTicket }

thomas.boll
Posts: 7
Joined: Wed Sep 02, 2015 12:34 pm

Re: Make item on wiki classic report to not show up

Postby thomas.boll » Wed Oct 28, 2015 12:54 pm

Hello,

if that can be done with the workitem-macro i do not know. But of course you can make a work-around with the tracker-api-functions:

Code: Select all

{regiontitle}
Aviation Statistics Module
{regiontitle}

#set ($SQL_Query = "...")  ## <-- Insert SQL-Query as decribed

#set ($workitemList   = $trackerService.getDataService().sqlSearch($SQL_Query ))
#if ( $workitemList.size() > 0 )
   {workitems: sqlQuery=$SQL_Query | fields=type, releaseNotes, novoTicket }
#end



Kind regards
Thomas


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 7 guests