You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
I try to create a button on bitbucket pull request overview page using ScriptRunner, but for some reason it doesn’t appears.
This button should open additional custom form.
My actions are:
Menu from step #2 [custom web item]:
My environment:
Atlassian Bitbucket v7.17.10
ScriptRunner version: 6.55.1
Chrome Version 106.0.5249.91 (Official Build) (64-bit)
P.s: I also try to follow adaptavist documentation, but the pictures are missing: https://docs.adaptavist.com/sr4bib/6.55.1/features/script-fragments/web-item
Code for myTestForm.groovy file [just for the test]
import com.atlassian.bitbucket.repository.RefService
import com.atlassian.bitbucket.repository.Repository
import com.atlassian.bitbucket.repository.ResolveRefRequest
import com.atlassian.sal.api.component.ComponentLocator
import com.onresolve.scriptrunner.parameters.annotation.RepositoryPicker
import com.onresolve.scriptrunner.parameters.annotation.ShortTextInput
import static com.atlassian.bitbucket.repository.StandardRefType.BRANCH
@RepositoryPicker(label = "Repository", description = "Enter the repository name")
Repository repository
@ShortTextInput(label = "Branch", description = "Enter the branch name")
String branchName
def refService = ComponentLocator.getComponent(RefService)
refService.resolveRef(new ResolveRefRequest.Builder(repository).with {
type(BRANCH)
refId("refs/heads/${branchName}")
}.build())
Can you assist please?
Thanks! Tamir