<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: How to add test case id to the test run? (Thread)</title><description> Hello,  Im using the Request Body to POST test run record (projects/{project_id}/test-runs/record).  But for some reason I see only  TestStepId  but now TestCaseId in the output.     However, if I do it manually then I can see both.     What am I missing in my Body Request?   start_time =    datetime.datetime.now().isoformat()
end_time =      datetime.datetime.now().isoformat()
body = {
    "StartDate":  start_time,
    "EndDate":    end_time,
    "TestCaseId":222222,
    "TesterId": 111,
    "ReleaseId":5555,
    "ExecutionStatusId":2,
    'RunnerName': 'Name Surename',
    'ProjectId': project_id,
    'ArtifactTypeId': 2,
    'RunnerTestName': 'Test Name!',
    "TestRunSteps": [
        {
        'Position': 1,
        "TestStepId": 333337,
        "TestCaseId":222222,
        'ProjectId': 112,
        "ExecutionStatusId": 2,
        "Description": "info goes here",
        "ActualResult": "result goes here",
        'ArtifactTypeId': 7,
        },
        {
        'Position': 2,
        "TestStepId": 333338,
        'ProjectId': 112,
        "TestCaseId":222222,
        "ExecutionStatusId": 2,
        "Description": "info goes here",
        "ActualResult": "result goes here",
        'ArtifactTypeId': 7,
        }
    ],
}
RUNNER_LINK = f"https://some_comapmy.com/SpiraTest/Services/v7_0/RestService.svc"
POST_TEST_RUN = f"projects/{project_id}/test-runs/record"
tr_record_url = f'{RUNNER_LINK}/{POST_TEST_RUN}'
request = requests.post(tr_record_url, data=json.dumps(body), params=params, headers=headers)
request.content   Best Regards, N </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/integrations/ide-integration/2878.aspx</link><item><guid isPermaLink="false">threadId=2878</guid><author>Navi Vogood (ishoro13@gmail.com)</author><category domain="http://www.inflectra.com/kronodesk/thread/tag">python</category><category domain="http://www.inflectra.com/kronodesk/thread/tag">teststepid</category><category domain="http://www.inflectra.com/kronodesk/thread/tag">testcaseid </category><title>How to add test case id to the test run?</title><description> Hello,  Im using the Request Body to POST test run record (projects/{project_id}/test-runs/record).  But for some reason I see only  TestStepId  but now TestCaseId in the output.     However, if I do it manually then I can see both.     What am I missing in my Body Request?   start_time =    datetime.datetime.now().isoformat()
end_time =      datetime.datetime.now().isoformat()
body = {
    "StartDate":  start_time,
    "EndDate":    end_time,
    "TestCaseId":222222,
    "TesterId": 111,
    "ReleaseId":5555,
    "ExecutionStatusId":2,
    'RunnerName': 'Name Surename',
    'ProjectId': project_id,
    'ArtifactTypeId': 2,
    'RunnerTestName': 'Test Name!',
    "TestRunSteps": [
        {
        'Position': 1,
        "TestStepId": 333337,
        "TestCaseId":222222,
        'ProjectId': 112,
        "ExecutionStatusId": 2,
        "Description": "info goes here",
        "ActualResult": "result goes here",
        'ArtifactTypeId': 7,
        },
        {
        'Position': 2,
        "TestStepId": 333338,
        'ProjectId': 112,
        "TestCaseId":222222,
        "ExecutionStatusId": 2,
        "Description": "info goes here",
        "ActualResult": "result goes here",
        'ArtifactTypeId': 7,
        }
    ],
}
RUNNER_LINK = f"https://some_comapmy.com/SpiraTest/Services/v7_0/RestService.svc"
POST_TEST_RUN = f"projects/{project_id}/test-runs/record"
tr_record_url = f'{RUNNER_LINK}/{POST_TEST_RUN}'
request = requests.post(tr_record_url, data=json.dumps(body), params=params, headers=headers)
request.content   Best Regards, N </description><pubDate>Tue, 19 Dec 2023 16:52:38 -0500</pubDate><a10:updated>2023-12-21T13:29:35-05:00</a10:updated><link>/Support/Forum/integrations/ide-integration/2878.aspx</link></item><item><guid isPermaLink="false">messageId=6555</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> Typically that field is populated with the Test Case ID because for manual tests you can include te</title><description> Typically that field is populated with the Test Case ID because for manual tests you can include test steps from other test cases, so its useful to know if it was from the primary test case, or one of the linked child test cases.  For automated tests, the results and the steps are always related to the primary test case, so the API doesnt populate that value on the steps. You can just see the test case on the top of the page. </description><pubDate>Wed, 20 Dec 2023 17:47:48 -0500</pubDate><a10:updated>2023-12-20T17:47:48-05:00</a10:updated><link>/Support/Forum/integrations/ide-integration/2878.aspx#reply6555</link></item><item><guid isPermaLink="false">messageId=6556</guid><author>Navi Vogood (ishoro13@gmail.com)</author><title> Hi David,  Got it.  Thank you for the quick response!   I wish you Merry Christmas and Happy New Ye</title><description> Hi David,  Got it.  Thank you for the quick response!   I wish you Merry Christmas and Happy New Year! </description><pubDate>Wed, 20 Dec 2023 19:01:53 -0500</pubDate><a10:updated>2023-12-20T19:01:53-05:00</a10:updated><link>/Support/Forum/integrations/ide-integration/2878.aspx#reply6556</link></item><item><guid isPermaLink="false">messageId=6557</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> Youre very welcome!  You too, happy holiday season. </title><description> Youre very welcome!  You too, happy holiday season. </description><pubDate>Thu, 21 Dec 2023 13:29:35 -0500</pubDate><a10:updated>2023-12-21T13:29:35-05:00</a10:updated><link>/Support/Forum/integrations/ide-integration/2878.aspx#reply6557</link></item></channel></rss>