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

Post result error One of Status ID, Assigned To or Comment is required


#1

Could you help me, please?
I have error when i try to post add_result:
testrail.APIException: TestRail API returned HTTP 400(“One of Status ID, Assigned To or Comment is required”)

Precondition:

TestRailAPIClient testRail = new TestRailAPIClient();
List testCases = testRail.getTests(runId);

It works and i have all cases from my run. Then i try to add result to TestRail using hardCode values:

JSONObject obj = new JSONObject();
JSONArray results = new JSONArray();
obj.put(“status_id”, 1);
results.add(obj);
testRail .sendPost(“add_result/1958021”, results);

testrail.APIException: TestRail API returned HTTP 400(“One of Status ID, Assigned To or Comment is required”)

Сould you tell me what I’m doing wrong?


#2

I’m resolved my issue
Map data = new HashMap();
data.put(“status_id”, new Integer(1));
data.put(“comment”, “This test worked fine!”);