Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Define variable in Bitbucket to pass to ScriptRunner scripts?

Brian_Merrill March 24, 2020

Is it possible to define important variables used in a ScriptRunner script in Bitbucket somewhere in order to keep the hard-coded values out of the script?  This is in case you want to keep things like URLs or other strings out of the script and in a place where an admin can change them in Bitbucket.

I saw a reference that ScriptRunner for Jira Cloud has variables that can be set but I can't find anything for Bitbucket server.

 

1 answer

0 votes
Kristian Walker _Adaptavist_
Community Champion
March 25, 2020

Hi Brian,

Thank you for your question.

I can confirm that the Script Variables feature is a feature which is currently only available inside of ScriptRunner for Jira Cloud and that this feature does not exist in any of the ScriptRunner for Server products currently.

I myself am not familiar with myself with ScriptRunner for Bitbucket Server but I have spoken to my colleague who is who has confirmed that no feature to achieve your requirement exists within the plugin.

If you have any further questions on this then I would advise contacting the ScriptRunner for Bitbucket Server support team located here who will be able to advise further on this issue.

I hope this information helps.

Regards,

Kristian

Brian_Merrill March 25, 2020

Hi Kristian.  Thanks for the answer, it confirms what I was able to find (or not find) when searching for an answer yesterday.

It would be really useful to be able to pass variables from the server to the script it hosts as this means the script would not need to be modified when it is moved from a testing to a production environment.  Our IT is concerned because the script has to be taken from the repo, and then modified, before installing into production.  But it is what it is...  we'll manage.

 

Thanks again.

Brian

Robert Giddings _Adaptavist_
Community Champion
March 30, 2020

@Brian_Merrill 

ScriptRunner for Jira Server has a feature called Dynamic Forms (https://scriptrunner.adaptavist.com/latest/jira/dynamic-forms.html).

This might be applicable to your use case?

And we are looking to include the same feature in ScriptRunner for Bitbucket.

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events