Commander
Commander
377 views

How to filter tests by Application Module and sub-modules at all levels?

Jump to solution

Should be possible to apply query to REST API call, so that it filters all tests linked to Application Module and its sub-modules at all lower levels. Expecting the same result as with UI when pointing to Application Module with "Show only direct descendants" option swithed off.

Labels (2)
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

@Vitaliy  general advice, when not sure how some thing can be done, if that flow is reproducible in Octane UI, it's easy to open browser dev tools and just look at the request sent by Octane UI.

We try our best to have one API available for both UI and Integrations, and as such UI consumption of REST api in many cases is the best example.

In this specific case, request would look like this

https://octane.example.com/api/shared_spaces/1001/workspaces/1002/tests?fields=id&
limit=100&
offset=0&
order_by=id&
query="(product_areas={(path='000000001ZG5*')})"

Here the `path` would be the path value of the root application module you want to filter by.

Need to note that `path` field of application_module / product_area entity at the moment is not exposed as part of public api, so to consume it you need to add to http request `ALM-OCTANE-PRIVATE` http header with the value `true`.

This means you will be using private api which may chnage in the future.

I will try to see if there is better way to do this not using any private apis, and will post on this thread if I will find any thing.

View solution in original post

1 Reply
Micro Focus Expert
Micro Focus Expert

@Vitaliy  general advice, when not sure how some thing can be done, if that flow is reproducible in Octane UI, it's easy to open browser dev tools and just look at the request sent by Octane UI.

We try our best to have one API available for both UI and Integrations, and as such UI consumption of REST api in many cases is the best example.

In this specific case, request would look like this

https://octane.example.com/api/shared_spaces/1001/workspaces/1002/tests?fields=id&
limit=100&
offset=0&
order_by=id&
query="(product_areas={(path='000000001ZG5*')})"

Here the `path` would be the path value of the root application module you want to filter by.

Need to note that `path` field of application_module / product_area entity at the moment is not exposed as part of public api, so to consume it you need to add to http request `ALM-OCTANE-PRIVATE` http header with the value `true`.

This means you will be using private api which may chnage in the future.

I will try to see if there is better way to do this not using any private apis, and will post on this thread if I will find any thing.

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.