Create Bitbucket ScriptRunner Repository Level Variables Edited

I am working on a simple plugin that can capture a PullRequestMergeEvent using Adaptavist ScriptRunner.  I haven't coded it yet but it looks like it will be an easy Event hook that triggers an http post event to our Jenkins or Bamboo instance.

I would like to write the script in a generic way so that I can use different values for our Jenkins/Bamboo instance depending on the repository.

Instead of coding an if/else block, is there a way to set custom properties or global varables at a repository level in bitbucket?

In an older plugin we coded a UI to gather some values but I was hoping that there was something out of the box where I can define things at a repostiroty lievel such as

 

jenkinsurl=myjenkins.myco.com
ci-job-name=some job name
etc...

1 answer

Hi Tim.

If you have access to your server, you could create a groovy file that contains your variables. For example an enum or whatever suits you.

When you need it, you can simply import it. So long as it is in your script roots, it should work.

Cheers!

DYelamos

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

128 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you