I've been using ScriptRunner for Jira for a long time now, but I've just started using ScriptRunner for Bitbucket and I'm having some issues trying to figure out how to write conditions properly. I'm currently trying to add a condition to auto-add a particular user as a reviewer for a PR if there are changes to a specific path using the "Auto add reviewers to pull requests" event handler (documented here).
For testing, I'm just trying add myself as a reviewer. This is current groovy script I'm using as a condition:
pathsMatch('glob:repo/path/to/file/**') || pathsMatch('glob:repo/other/path/for/auto/add/**')
I have also tried this:
def pullRequest = event.pullRequest
pullRequest.pathsMatch('glob:repo/path/to/file/**', pullRequest.getCommits()) || pullRequest.pathsMatch('glob:repo/other/path/for/auto/add/**', pullRequest.getCommits())
These scripted conditions aren't working for me, though. Am I using an incorrect syntax? I also don't understand if I'm supposed to be include the repo name or not if this script event handler is configured on a single repo.