Support

Expand all | Collapse all

How to get the number of items in a Set /Folder of test cases

  • 1.  How to get the number of items in a Set /Folder of test cases

    Posted 12-04-2019 16:55
    ​Hello,

    Is there any way (VTL macro or API) to get the no. of items from Set/Folder of test case . e.g the JAMA GUI shows the no. of items , I am looking for any API to just read the no.
    Following is snapshot from JAMA
    snapshot for Set of test cases

    I can do it using foreach , but is there any other way too ??
    #set($Total_count=0)
    #foreach( $vDoc in $documentList)
           #set($Total_count = $Total_count+1)
    #end
    Thanks and Regards,
    Monika
    ​​

    ------------------------------
    Monika Tripathi
    ResMed
    ------------------------------


  • 2.  RE: How to get the number of items in a Set /Folder of test cases

    Posted 12-05-2019 12:22
    Hi Monika,

    Thanks for the question! If you have the item ID of the set/folder you can get this information from the API using the GET /items/{id}/children endpoint.

    You can get the set/folder id from the URL by selecting the set/folder.
    Set ID from URL
    One way to use our API is to use the Swagger app. You can get to the Swagger application by going to <your Jama URL>/api-docs. From here you can scroll down and select Items->GET /items/{id}/children. Then select "try it now", enter the set/folder id and select "execute.

    API
    The "total results" in the response is the number of test cases in the set/folder.
    results
    I hope that helps! 
     

    ------------------------------
    Jason Ritz
    Jama Software
    OR
    ------------------------------



  • 3.  RE: How to get the number of items in a Set /Folder of test cases

    Posted 12-05-2019 18:59
    ​Hello Jason,

    Thanks for quick reply, Can I use this swagger app API in Velocity.
    My aim is to create a velocity template for export the report from JAMA.

    Thanks and Regards,
    Monika

    ------------------------------
    Monika Tripathi
    ResMed
    ------------------------------



  • 4.  RE: How to get the number of items in a Set /Folder of test cases

    Posted 12-06-2019 07:41
    Monika:

    Unfortunately, no Swaggar only works with the REST API at the moment.

    We have a Velocity section under Education > Velocity Advanced Reporting in the Community. You can take a look there to see the resources available to help.

    Best,

    ------------------------------
    Chloe Elliott
    Jama Software
    Portland OR
    ------------------------------