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, can you attach your screen shot. I placed my code in the script post-hook but get no error
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.