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

Can't delete project


#1

I keep getting this while trying to delete an existing project(with admin privileges)
TestRail API returned HTTP 400(“Field :project_id is a required field.”)

Test Code(Relevant part)
String new_project_id = “”;
if(reply.containsKey(“id”))
new_project_id = reply.get(“id”).toString();
if(new_project_id != “” && reply.get(“name”).equals(“ABCD v1”)) {
System.out.println(“HURAYYY!!!”);
JSONObject existing_project = (JSONObject) apiClient.invokeGET(“get_project/” + new_project_id);
System.out.println(existing_project.toString());
//delete the project
Map payload_delete_project = new HashMap();
payload_delete_project.put(“project_id”, Integer.parseInt(new_project_id));
JSONObject delete_project_reply = (JSONObject) apiClient.invokePUT(“delete_project/”, payload_delete_project);
System.out.println(delete_project_reply.toString());
}

Any pointers why this keeps happening