How to fetch pull requests filtered by state#
Introduction#
To fetch pull requests filtered by state you need to add the filter option to the config file for the Git fetcher. Currently, this works only with Bitbucket. Possible filter values for the state are one of DECLINED, MERGED, OPEN, ALL
. The state filter is optional. Using ALL
leads to the same result as leaving the state filter out.
Adjust the config file#
Now, you need to adapt the configuration file for state filtering.
Add the key
state
to the filter section.As value, choose one of
DECLINED, MERGED, OPEN, ALL
.
This is a sample file:
org: your-bitbucket-org
repo: your-repository
resource: prs
filter:
state: ALL # Optional. One of: DECLINED, MERGED, OPEN, ALL. Only works with Bitbucket.
The state and date filter can be combined.
Adjust the environment variables#
Make sure to also update your environment variables as done in How to fetch all pull requests with a certain label from GitHub. An example for a full qg-config.yaml
can be found in the reference section here here.