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

[API enhancements] Add support for sub-sections and add configurations


#1

Hello,
The API currently does not have support for

  • add config. I have to do this manually for now

  • get_sub_section/:section_id. There is no way to get the subsections for a particular section. I have to iterative over all of them.


#2

Hello Ali,

Thanks for your posting and your feedback on the API. Please see below for my answers:

  1. Write support for configurations is already on our todo list. Do you have many configurations that also change frequently?

  2. You would need to use get_sections for this currently which returns the entire section hierarchy for a test suite. You can use the ‘depth’ and ‘parent_id’ properties to find out the sub-hierarchy for a particular section and we are happy to help in case you have any questions about this.

We will make sure to think about adding an additional :section_id argument to get_sections or adding a get_sub_sections method to the API, thanks for the idea!

Regards,
Tobias


#3

Tobias, include me in your count for people who want the ability to get sub-sections using the API. (I really want to get all cases for a section and its subsections since I use sections to visually organize test cases, however perhaps just getting the subsections of a section and then manually retrieving cases for each of those sections is a more flexible solution.)

I sat down to solve this problem smartly for myself, realized I got a C in dynamic programming in college, then just hard-coded a solution in my integration framework for right now.

[quote=tgurock]Hello Ali,

Thanks for your posting and your feedback on the API. Please see below for my answers:

  1. Write support for configurations is already on our todo list. Do you have many configurations that also change frequently?

  2. You would need to use get_sections for this currently which returns the entire section hierarchy for a test suite. You can use the ‘depth’ and ‘parent_id’ properties to find out the sub-hierarchy for a particular section and we are happy to help in case you have any questions about this.

We will make sure to think about adding an additional :section_id argument to get_sections or adding a get_sub_sections method to the API, thanks for the idea!

Regards,
Tobias[/quote]


#4

Hello Kevin,

Sure, I’ve just added another vote to this request, thanks! The section hierarchy details are already included in the get_sections response but I understand that a method to query sub-sections would also be useful to have.

Regards,
Tobias


#5

Hi Tobias,

Please add my vote for subsections as well. They have unique ids and a “get_subsection” or the ability to “get_cases” for subsections will be brilliant.

Thanks,
Sriram


#6

Hi Sriram,

Subsections are already included as part of get_sections and this includes all sections and all details to build the section tree. I understand that a section filter for get_sections or a new API method for this purpose would be more convenient though and I’m happy to add another vote, thanks for your feedback!

Just for completeness (topic of this thread): add_config and other configuration related API methods are now available:

http://docs.gurock.com/testrail-api2/reference-configs

Cheers,
Tobias


#7

Add my vote for supporting sub-sections in the API

I’m setting up a new project and it would be so nice (and efficient) to be able to create all my sections and sub-section from a script, rather than through the UI - there’s a lot of them

Cheers
Simon


#8

Hi Simon,

The TestRail API actually has support for adding sub-sections via the add_section method, and you would just need to be sure to specify the parent_id request field of the parent section in your request when adding the sub-section. You can learn more about this and see an example response here:

http://docs.gurock.com/testrail-api2/reference-sections#add_section

Hope this helps!

Regards,
Marco


#9

Please add my vote to this feature. Or at least publish some example code to iterate through a given section, to get the section hierarchy?

My expectation of an API would be to allow me to easily perform things I can do, via the UI. I can export section hierarchy so why not have that in the API as well instead of asking everyone to code it?