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

[solved] Include_all not boolean and cases_ids not an array


Hello all,

I have been searching and trying different approaches, but I am stuck.

This is the POST request sent:
{"include_all":"false","case_ids":"[111615]","name":"Sprint 10 2","assignedto_id":23,"description":"A simple description.","suite_id":219}

But I receive a:
com.gurock.testrail.APIException: TestRail API returned HTTP 400("Field :include_all is not a valid boolean.")

I declared the boolean like this:
map.put("include_all", new Boolean(false));

I get rid of this error, when I replace the declaration by this:

This is weird and I was just guessing for a solution. I did not find it documented like this.
Nevertheless, I get the next error, which is relates to case_ids
com.gurock.testrail.APIException: TestRail API returned HTTP 400("Field :case_ids is not a valid array.")

I was declaring the array of case_ids like this:

JSONArray case_Ids = new JSONArray(); case_Ids.add(new Integer(111615)); map.put("case_ids", case_Ids);
no success

List case_Ids = new ArrayList(); case_Ids.add(new Integer(111615)); map.put("case_ids", case_Ids);
no success

map.put(“case_ids”, “[111615]”);`
no success

So, I am out of luck after having tried the recommendations I found in this forum and in the documentation.

Any ideas, please?


I solved it, it was my implementation error:
I wrote a JSON-Parser, that treats arrays as Strings and therefore converts them incorrectly.


Hi Marvin,

Thanks for the update! The API wouldn’t allow strings for bool/array fields so that would be expected. Glad to hear you were able to get this working now!



I too tried all three options to pass values to case_ids key, but none of them worked. I tried JSONArray, Array & Arraylist and actual values but none of these worked. @marvin/@mgarcia can you please let me know what value did you pass for case_ids…how did you declare it etc. Any help is appreciated.


@akatta @mgarcia

I am also having this problem with Java implementation. It seems the API does not like me passing the address of the array to it. It also doesn’t like it de-referenced as a string, per the documentation it states “array” but Java requires that you dereference that or pass the address and your API doesn’t like the address. Looking for a resolution here. What did you guys come up with?



Using an ArrayList seemed to solve my issue. Add the ids to the ArrayList and then call the .put(“case_ids”, arrList); Was trying to use an int[]. This should help anyone else that is having issues with the “Field :case_ids is not a valid array.” error.