I want to use script runner plugin which will send the body and trigger a remote call to the CI.
As part of the body, I need repository name and project_key details. I am using script Post hooks, Is there a easy way to get those details?
Hi @pp
I never tried this, but mostly below snippet should give you the repo name and project key
import com.atlassian.bitbucket.repository.RepositoryService;import com.atlassian.bitbucket.repository.Repository;def repo_name = repository.getName()def proj_key = repository.getProject().getKey()
BR,
Leo
Hi Leo,
I am new to groovy, learning myself.
The above snippet throws below error:
[Static type checking] variable [repository] is undeclared.
Hi, can you attach your screen shot. I placed my code in the script post-hook but get no error
Thanks Leo, my bad. I am not getting error too and your code works great.
It looks like you're new here. Sign in or register to get started.