DB Query in Spira Spits out Error for Unknown Reason

Friday, July 11, 2014 4:13:03 PM

Hello,

My company would like me to create  a sum of the test steps that have passed, failed, blocked, etc. instead of test cases.

I tried to do my own SQL query - and it works when I access the database by the SQLCMD utility, but not in the Spira query under the custom reports.

Here it is - maybe someone will know what's going on?

SELECT

SUM(CASE WHEN execution_status_id=2 then 1 else 0 end) as Pass

FROM TST_TEST_STEP      (<----From SQLCMD Utility - when I do it from the query I replace TST_TEST_STEP with SpiraEntities.R_TestSteps)

It is creating a sum correctly in the back door, but when I try and execute this in Spira I get ther error:

 execution_status_id could not be resolved in current scope or context.

Any help would be appreciated.

Thanks,

Erin

1 Replies
Friday, July 11, 2014 4:27:22 PM
Avatar
re: welc0199 on Friday, July 11, 2014 4:13:03 PM

Seems to work when I make the table as R.

This finally generated correctly:

SELECT

SUM(CASE WHEN R.EXECUTION_STATUS_ID=2 THEN 1 ELSE 0 END) AS PASSED,

SUM(CASE WHEN R.EXECUTION_STATUS_ID=1 THEN 1 ELSE 0 END) as FAILED,

SUM(CASE WHEN R.EXECUTION_STATUS_ID=6 THEN 1 ELSE 0 END) as CAUTION,

SUM(CASE WHEN R.EXECUTION_STATUS_ID=5 THEN 1 ELSE 0 END) as BLOCKED,

SUM(CASE WHEN R.EXECUTION_STATUS_ID=3 THEN 1 ELSE 0 END) as NOTRUN

from SpiraTestEntities.R_TestSteps as R

where R.PROJECT_ID = ${ProjectId}

Thank you!

Erin

Statistics
  • Started: Friday, July 11, 2014 4:13:03 PM
  • Last Reply: Friday, July 11, 2014 4:27:22 PM
  • Replies: 1
  • Views: 587