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

How to add test results under an existing Test Plan?

Hi All,

I’m trying to add test results using CLI command in an existing Test Plan. But result is not getting in. Can you please help me?

        curl -H "Content-Type: application/json" \
        -u "$TESTRAIL_USERNAME:$TESTRAIL_PASSWORD" \
        -d '{"suite_id":3269,"name":"Run 1","assignedto_id":1,"include_all":true,"config_ids":[1,2,3,4],"runs":[{"case_ids":[6,7,8,9,10],"config_ids":[1]}]}' \
        "https://example.testrail.io/index.php?/api/v2/add_plan_entry/7494"

But while running Tests in an existing Test run I’m able to add the test result.

        curl -H "Content-Type: application/json" \
        -u "$TESTRAIL_USERNAME:$TESTRAIL_PASSWORD" \
        -d '{
          "results": [
            {
              "status_id": 5,
              "comment": "This test failed",
              "defects": "TR-7"

            },
            {
              "test_id": 1609579,
              "status_id": 1,
              "comment": "This test passed",
              "elapsed": "5m",
              "version": "1.0 RC1"
            },
            {
              "test_id": 1609580,
              "assignedto_id": 5,
              "comment": "Assigned this test to Joe"
            }

          ]
        }' \
        "https://example.testrail.io/index.php?/api/v2/add_results/7491"