Pull requests merged through the API are not auto closing issues (closing keywords)


I have a probot app that merges pull requests once all CI statuses succeed. 

Some users reported that the pull requests merged with the bot are not triggering closing issues with keywords.

I could reproduce it with this pull request and this issue.

Is closing via API supposed to behave as closing via web? 

The mystery has been solved :tada:

After playing back-and-forth, even trying some non-sense stuff. I found the problem!

\ giphy

The bot needs issue write permissions, otherwise closing issues using keywords will “fail silently” (╯°□°)╯︵ ┻━┻

1 Like

Hey @phstc,

Thanks a lot for being here, we appreciate you coming back to share your solution.

1 Like

We’re observing the same issue, but with the Mergify app. Which does seem to have issue write permission, so I’m stumped as to how to solve this…

Hi @mboes 

If the problem is with permissions you may be able to see some specific errors in the logs.

Turns out this was the same problem as for you. It’s been fixed by upstream since a couple of months ago. See https://github.com/Mergifyio/mergify-engine/issues/466#issuecomment-520297764.