Filtering is the best way to find projects that have a property in common. For
example, all the projects that you have designated with the same internal group or
application name.
The syntax for the filtering portion of the request is as follows:
?filter[type][attribute][key_name][operator]
- The question mark signifies the end of the URL and the beginning of query parameters.
typedescribes the type of record for which you're searching; in this case it'sproject.keyis the property key for which you want to find a match. If you want to find projects that belong to the purple group, the key isgroup. Think of the key/value pairgroup:purple.operatoris the database filtering operator. For this search, use$eq(equals).valueis the value against which to compare. In the search for projects that belong to the purple group, the value ispurple.
Submit the request as follows.
GET https://subdomain.cop.blackduck.com/api/common/v0/projects/?page[limit]=25&page[offset]=0\
&filter[project][properties][group][$eq]=purple
In this example, the request searches for projects that belong to the purple group. Notice that the request includes page limit and offset parameters in the query. These are required for filtering requests in the Coverity on Polaris API.
GET https://subdomain.cop.blackduck.com/api/common/projects?page[limit]=25&page[offset]=0\
&filter[project][properties][group][$eq]=purple
&filter[project][properties][application][$eq]=VulnEraser
In this example, the request has two filters. It only finds projects that belong to the purple group and to the VulnEraser application.