To create a custom report you need to:

  1. Go to Administration  > Edit Reports
  2. Create a new Report
  3. Specify that it should allow generation in MS-Word, Excel, HTML and PDF formats
  4. Choose to add a Custom Section and enter in the following:
SELECT R.REQUIREMENT_ID, R.INDENT_LEVEL, R.IS_DELETED 
FROM SpiraTestEntities.R_Requirements AS R 
WHERE R.PROJECT_ID = X AND 
 SUBSTRING (anyelement 
              (select value T.INDENT_LEVEL from SpiraTestEntities.R_Requirements as T where T.REQUIREMENT_ID = Y), 1, length(R.INDENT_LEVEL)) = R.INDENT_LEVEL 
ORDER BY R.INDENT_LEVEL

(where you change the ID of the requirement ID to match the one you are trying to find instead of the value "Y" that you see in this example and you change the placeholder "X" to be the project ID). This will then display the requirement IDs of this requirement's parents.

This will then display something like the following:

REQUIREMENT_IDINDENT_LEVELIS_DELETED
1AAAFalse
2AAAAAAFalse
3AAAAAAAAAFalse
4AAAAAAAAAAAAFalse