Maybe get the states from the adapter?
Because bitbucket has 'open', 'merged' and 'declined' states, so it will always throw an error here if you don't choose open.