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

API add_plan_entry() runs don't override include_all


Calling the TestRail API from Python, I add an entry with 2 runs. The entry struct only contains suite_id, name and runs. I understand that include_all is True by default. Both runs have include_all set to False and case_ids set. However, the resulting test plan entry has all cases in each run.

# Loop over entries in original test Plan
if len(testPlan['entries']) > 0 :
    for entry in testPlan['entries'] :
        entryStruct = {'suite_id' : entry['suite_id'], 'name' : entry['name']}
        runsList = []
        for run in entry['runs'] :
            newRunStruct = {'include_all' : run['include_all'], 'config_ids' : run['config_ids']}
            tests = client.send_get( 'get_tests/' + str( run['id']))
            caseIDs = []
            for test in tests :
                caseIDs.append( test['case_id'])
            newRunStruct['case_ids'] = caseIDs
            runsList.append( newRunStruct)
        entryStruct['runs'] = runsList
        newEntry = client.send_post( 'add_plan_entry/' + str( newPlan['id']), entryStruct)