Page 1 of 1

Make item on wiki classic report to not show up

Posted: Wed Oct 14, 2015 6:49 pm
by fmanchester
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 }

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

Posted: Wed Oct 28, 2015 12:54 pm
by thomas.boll
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