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

Un-assign test at the test level


Hello all,

I wrote a script in python that un-assigns tests within a test run.

if test_plan_dict["entries"]:
        for entry in test_plan_dict["entries"]:
            entry_id = entry["id"]
            modified_entry = client_obj.send_post(f"update_plan_entry/{test_plan_id}/{entry_id}", {"assignedto_id": None} ) # remove assignment at entry level
            if entry["runs"]:
                for run in entry["runs"]:
                    run_id = run["id"]
                    tests = client_obj.send_get(uri=f"get_tests/{run_id}")
                    results_dict = {"results":[]}

                    for test in tests:
                        results_dict["results"].append({"case_id":test["case_id"], "assignedto_id": None})

                    modified_tests_in_run = client_obj.send_post(f"add_results_for_cases/{run_id}", results_dict) # remove assignment at test case level
                    print (modified_tests_in_run)

    return test_plan_dict

I am able to un-assign at the entry level, but I am not able to un-assign at the test case level. I seem to be running into the same issue as this person:

Does anyone have a work around? For now, I am just assigning all of the test cases to a temp account on our org.

Basically if I do this:

results_dict["results"].append({"case_id":test["case_id"], "assignedto_id": 30})

it works

But doing this does not work:

results_dict["results"].append({"case_id":test["case_id"], "assignedto_id": None})