Skip Navigation LinksHome Page > Forums > SpiraTeam Forums > SpiraTeam Issues & Qu... > Custom Query Help
Hi, I've written the following custom query but am having trouble getting the Count values for my requirments and incidents, as what is returned is 'System.Data.Query.ResultAssembly.BridgeDataReader' instead of an integer value.
Any idea how I can get this to work?
Thank you!
select R.CUST_05 AS IMPLEMENTATION_DATE, R.PROJECT_NAME, R.NAME AS RELEASE_NAME, R.RELEASE_ID, R.TASK_ESTIMATED_EFFORT AS ESTIMATED_EFFORT, R.TASK_ACTUAL_EFFORT AS ACTUAL_EFFORT,(select value count(S.INCIDENT_ID) from SpiraTestEntities.R_Incidents as S where S.DETECTED_RELEASE_ID = R.RELEASE_ID) AS INCIDENT_COUNT,(select value count(Q.REQUIREMENT_ID) from SpiraTestEntities.R_Requirements as Q where R.RELEASE_ID = Q.RELEASE_ID && (NOT Q.IS_DELETED) && (Q.IMPORTANCE_ID = 1) && (NOT(Contains(Q.DESCRIPTION, 'AUDIT')))) AS REQUIREMENT_COUNTfrom SpiraTestEntities.R_Releases as Rwhere (R.PROJECT_GROUP_ID = 19) && (R.ACTIVE_YN = 'Y') && (Cast(R.CUST_05 as DateTime) BETWEEN AddDays(CurrentDateTime(), -7) AND AddDays(CurrentDateTime(), 0))order by R.PROJECT_NAME, RELEASE_NAME
Follow-up: I got this to work by adding ANYELEMENT as a wrapper to my query.
For example:
ANYELEMENT(select value count(Q.REQUIREMENT_ID) from SpiraTestEntities.R_Requirements as Q where R.RELEASE_ID = Q.RELEASE_ID && (NOT Q.IS_DELETED) && (Q.IMPORTANCE_ID = 1) && (NOT(Contains(Q.DESCRIPTION, 'AUDIT')))) AS REQUIREMENT_COUNT
returns me a value of 11, which is correct!
And if you have any questions, please email or call us at +1 (202) 558-6885