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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Leo Is there a bitbucket server API to get the branch name ? I am creating a script posthook using script runner plugin to trigger CI upon a pullrequest merge trigger event.
I need to find the branch name of the pullrequest where it got merged, to send it as a parameter to CI.
I was browsing through the bitbucket server API's did not find any. Is there a way to get it this info?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.