Forum Discussion

pricedgp's avatar
2 years ago

Retrieve Requirement ID using Groovy

Using Groovy, I'd like to include the requirement ID(s) associated with a test case in some output. I can't find any documentation on where in the API I can find this, or how to get to it. I thought it would be associated with the test case itself, but I don't see it. Any help is greatly appreciated. 

3 Replies

  • KarelHusa's avatar
    Champion Level 3

    A simple way would be to set a custom TestCase property to the requirement ID.

    Next, what do you mean by output? A report, or sending the ID with a test request?

  • The "requirement Id" I'm referring to is the one (or more) that is shown in ReadyAPI when you select Requirements while your focus is on a test case. I'm trying to retrieve that -- not sure how to do that programatically.  I don't want to create a custom property in a test case when there's already functionality to capture the requirement id in the product. 


    If I can find a way to get to that requirement ID from either context, testCase, or testRunner, I can do the rest of it.