<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: Getting IndentLevel for Test Folders (Thread)</title><description> When we create a requirements document/report (custom), I use the IndentLevel field in the Requirements table to make sure the requirements appear in the document in the same order an hierarchy as they do in the Spira GUI (using Word heading levels). IndentLevel will look something like AAAAAAC, signifying both the order and the nesting level in the tree of a specific item.  If I want to do the same for a Test Specification, based on the Test Case Folders, this does not seem to be so simple. The default Test Case Folder table does not include an IndentLevel field, only a ParentFolder field. ParentFolder is not so easy to use when building up a document, since you need to reconstruct the hierarchy of folders before being able to do anything.  Now the Standard section available in Spira called Test Case List does have a property IndentLevel, which is what I need. However, I cannot use Standard sections because my documents consist of multiple custom sections and adding a standard section will always automatically put its contents first in the document, before all other sections, messing up the document order.  So Id like to know, is there an easy way to reconstruct the IndentLevel for test case folders using SQL or XSLT? Im not THAT great with SQL, so any help would be appreciated!  </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spirateam/reports/2849.aspx</link><item><guid isPermaLink="false">threadId=2849</guid><author>D L (dennis.lardenoye@pie.nl)</author><title>Getting IndentLevel for Test Folders</title><description> When we create a requirements document/report (custom), I use the IndentLevel field in the Requirements table to make sure the requirements appear in the document in the same order an hierarchy as they do in the Spira GUI (using Word heading levels). IndentLevel will look something like AAAAAAC, signifying both the order and the nesting level in the tree of a specific item.  If I want to do the same for a Test Specification, based on the Test Case Folders, this does not seem to be so simple. The default Test Case Folder table does not include an IndentLevel field, only a ParentFolder field. ParentFolder is not so easy to use when building up a document, since you need to reconstruct the hierarchy of folders before being able to do anything.  Now the Standard section available in Spira called Test Case List does have a property IndentLevel, which is what I need. However, I cannot use Standard sections because my documents consist of multiple custom sections and adding a standard section will always automatically put its contents first in the document, before all other sections, messing up the document order.  So Id like to know, is there an easy way to reconstruct the IndentLevel for test case folders using SQL or XSLT? Im not THAT great with SQL, so any help would be appreciated!  </description><pubDate>Wed, 13 Sep 2023 13:26:02 -0400</pubDate><a10:updated>2025-06-02T05:45:33-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2849.aspx</link></item><item><guid isPermaLink="false">messageId=6197</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> Hi DL  Unfortunately not really.  We have an internal SQL Server stored procedure that populates a </title><description> Hi DL  Unfortunately not really.  We have an internal SQL Server stored procedure that populates a cache table of the test case folder hierarchy ( TST_TEST_CASE_FOLDER_HIERARCHY ) but it is not currently exposed as a reportable entity for ESQL. You could raise a support ticket and ask our team to add  TST_TEST_CASE_FOLDER_HIERARCHY  as a reportable entity?  Regards  David </description><pubDate>Fri, 15 Sep 2023 12:06:11 -0400</pubDate><a10:updated>2023-09-15T12:06:11-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2849.aspx#reply6197</link></item><item><guid isPermaLink="false">messageId=6675</guid><author>David Tyler (mckaybauer8940763@gmail.com)</author><title> Using SQL. This approach involves creating a CTE that iterates through the folder hierarchy. The CT</title><description> Using SQL. This approach involves creating a CTE that iterates through the folder hierarchy. The CTE joins the TestCaseFolder table with itself, looking for matching ParentFolder IDs. With each iteration, a counter variable (like Level) is incremented to represent the nesting depth. The final query selects the folder data along with the calculated Level as the IndentLevel.     geometry dash lite     For example:   WITH FolderHierarchy AS (
  SELECT FolderID, ParentFolderID, 0 AS Level
  FROM TestCaseFolder AS Root
  WHERE ParentFolderID IS NULL
  UNION ALL
  SELECT F.FolderID, F.ParentFolderID, H.Level + 1
  FROM TestCaseFolder AS F
  INNER JOIN FolderHierarchy AS H ON F.ParentFolderID = H.FolderID
)
SELECT FolderID, ParentFolderID, Level AS IndentLevel
FROM FolderHierarchy;     </description><pubDate>Mon, 06 May 2024 02:21:28 -0400</pubDate><a10:updated>2024-05-06T02:21:28-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2849.aspx#reply6675</link></item><item><guid isPermaLink="false">messageId=6684</guid><author>Lyle Clemons (lindagilson806@hotmail.com)</author><title> Or you can use XSLT: If youre working with exported data (e.g., from a Spira database), you can tra</title><description> Or you can use XSLT: If youre working with exported data (e.g., from a Spira database), you can transform it using XSLT. Heres a simplified example of how you might approach this: Assume you have an XML representation of test case folders. Write an XSLT stylesheet that: Parses the XML. Recursively processes the folders. Determines the depth of each folder. Constructs the IndentLevel based on the depth. Outputs the transformed XML.  Example    
   
     
       
         
       
       
     
     
   
 
   You can get more guides here:  https://learn.microsoft.com/en-us/sql/relational-databases/sqlxml-annotated-xsd-schemas-xpath-queries/net-framework-classes/applying-an-xsl-transformation-sqlxml-  smash karts  -managed-classes?view=sql-server-ver16  </description><pubDate>Thu, 09 May 2024 09:21:35 -0400</pubDate><a10:updated>2024-05-09T09:21:35-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2849.aspx#reply6684</link></item><item><guid isPermaLink="false">messageId=6693</guid><author>D L (dennis.lardenoye@pie.nl)</author><title> Thanks David. In the mean time, I solved the problem with XSLT, which turns out the same as the sol</title><description> Thanks David. In the mean time, I solved the problem with XSLT, which turns out the same as the solution proposed by  lyleclemons  in this thread.  </description><pubDate>Wed, 15 May 2024 13:59:19 -0400</pubDate><a10:updated>2025-09-29T12:38:12-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2849.aspx#reply6693</link></item></channel></rss>