Reporting querry - Select incidents by user's department

Friday, September 20, 2013
Avatar

Hi,

I'm trying to build a querry which will extract all incidents for a project which were raised by members of the same department.

I was able to create some of the pieces of the querry (see below) but I am not able to put them together into a single querry so that I get the report I'm after. Anyone able to provide some help with this?

select value R from SpiraTestEntities.R_Incidents as R where R.PROJECT_ID = ${ProjectId}
select value R from SpiraTestEntities.R_Incidents as R where R.OWNER_ID = 'Tom'
select R.USER_ID from SpiraTestEntities.R_Users as R where R.DEPARTMENT= 'ICT'

I am able to select the incidents by user and the users which are part of the ICT department, however I don't know how to combine it all together.

Thanks for any help.

2 Replies
Tuesday, September 24, 2013
Avatar
re: ttoth Friday, September 20, 2013

Hi Thomas

Something like:

select value R from SpiraTestEntities.R_Incidents as R where R.PROJECT_ID = ${ProjectId} and R.OWNER_ID = 'Tom' and R.DEPARTMENT = 'ICT'

Regards

Adam

Thursday, October 3, 2013
Avatar
re: inflectra.david Tuesday, September 24, 2013

Sorry for the late feedback, I only saw your reply today.

Unfortunately that doesn't work as R_Incidents doesn't have R.REPARTMENT in it. I need to find a way to join the two tables based on the user_id.

I get the error message 'DEPARTMENT' is not a member of type 'Inflectra.SpiraTest.DataModel.R_Incident' in the currently loaded schemas. Near simple identifier, line 1, column 86'.

 

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Friday, September 20, 2013
  • Last Reply: Thursday, October 3, 2013
  • Replies: 2
  • Views: 1964