Find projects that share properties

Coverity on Polaris

Version
latest
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.
  • type describes the type of record for which you're searching; in this case it's project.
  • key is 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 is group. Think of the key/value pair group:purple.
  • operator is the database filtering operator. For this search, use $eq (equals).
  • value is the value against which to compare. In the search for projects that belong to the purple group, the value is purple.
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.