What is the correct way to update "testRunStatus" via rest API?
The below method takes an ID of a TEST_CYCLE and gets a list of the TEST_RUNS.
For each of the test runs, I want to update the “testRunStatus”.
def jama_testplan_update(self, source_id: int):
print("PROJECT: ", self.project_name)
cycle_dict = self.get_test_cycle(source_id)
print("TEST_CYCLE ID : ", cycle_dict['id'], "IS OF TYPE :", cycle_dict['type'])
test_run_list = self.get_testruns(cycle_dict['id'])
for i in test_run_list:
print("ID: ", i['id'], " OF TYPE: ", i['type'])
print("\t testCase: ", i['fields']['testCase'] , "status : ", i['fields']['testRunStatus'])
self.patch_item(i['id'], [{"op": "replace", "path": f"/fields/testRunStatus", "value": result.value}])
When I try to use patch_item, I get this error:
PROJECT: Omni Hunter CPUSS FuSa - trial run
TEST_CYCLE ID : 706347 IS OF TYPE : testcycles
ID: 706348 OF TYPE: testruns
testCase: 678300 status : NOT_RUN
[ERROR] -- API Client Error. Status: 404 Message: Item with ID "706348" does not exist
In the previous line, I am printing the fields of that ID. The ID does exist.
I can use patch_item on types of TEST_CASE and TEST_CASE_RESULT.
What is the correct way to update "testRunStatus" via rest API?