Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

How to get All test runs which are part of any plan


#1

http://docs.gurock.com/testrail-api2/reference-runs#get_runs

which returns those test runs that are not part of a test plan .

My question is how can I get all test runs which are part of a test plan ? I didn’t find any method for this


#2

For test runs within plans, you have to get the plan(s) first, then you can get all of the runs within the plan. Here is a quick example using curl from the command line.

First I see that I have a plan with ID 29, then I get that plan, grepping out the run IDs just for this example.

$ curl -u user@company.com:$PASS  -s -X GET -H 'Content-Type: application/json' http://testrailsrv.company.com/testrail/index.php?/api/v2/get_plans/5  | python -mjson.tool | grep \"id\"
        "id": 5,
        "id": 29,
$ curl -u user@company.com:$PASS  -s -X GET -H 'Content-Type: application/json' http://testrailsrv.company.com/testrail/index.php?/api/v2/get_plan/29  | python -mjson.tool | egrep '(\"id\": [0-9]|\"runs\")'
            "runs": [
                    "id": 30,
            "runs": [
                    "id": 31,
            "runs": [
                    "id": 32,
            "runs": [
                    "id": 33,
            "runs": [
                    "id": 34,
            "runs": [
                    "id": 35,
            "runs": [
                    "id": 36,
            "runs": [
                    "id": 37,
            "runs": [
                    "id": 38,
    "id": 29,

$

#3

Thanks for the reply but i cant understand this . Can you provide any c# example or any link which explain the method under the following

http://docs.gurock.com/testrail-api2/start


#4

Hello,

Thanks for your posting. As Tim already mentioned (thank you!), you can simply call the get_plan API method for this:

http://docs.gurock.com/testrail-api2/reference-plans#get_plan

For accessing the API with C#, please refer to our C# API binding which also includes examples:

http://docs.gurock.com/testrail-api2/bindings-dotnet

I hope this helps and please let me know in case you have any further questions!

Regards,
Tobias


#5

sorry tgurock my bad . I didn’t check the response of get_plan method … many thanks :smiley:


#6

You are welcome!

Regards,
Tobias