Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,467
Community Members
 
Community Events
184
Community Groups

Unable to display a button on the pull request overview page using ScriptRunner

Edited

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.

BitBucket.png

 

My actions are:

  1. Login to bitbucket admin page -> SCRIPTRUNNER -> Fragments
  2. Create Fragment -> Custom Web Item
  3. Fill all fields while specifying in section field: bitbucket.pull-request.toolbar.actions
  4. Click on Update
  5. Refresh existing pull request. The button is missing

 

Menu from step #2 [custom web item]:

WebItem.JPG

 

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

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events