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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to set up Script Variables in Script Runner

I read the following documentation on Script Variables in Script Runner ( and how to use it in your script, but it does not describe how to set up a variable.

For example, in the documentation it say's that the variable


has the value


but how do you set that variable and where? Do you set it up in JIRA or the server that is running JIRA?

3 answers

0 votes


Yes - it seems I gave you a link that only works in cloud

For one of our Data Centre projects, in order to set global properties, that differ for dev, staging and prod, we put the values into on the the servers.

sysAcc = jirauser


def propertyManager = ComponentAccessor.getApplicationProperties()

def myUsername = propertyManager.getDefaultBackedString('sysAcc')


Thanks, I will look at this option.

In case it is useful for someone else, what I ended up doing in the interim since I am using Jira Server via the Atlassian Docker images was pretty simple: just setting an environment variable that I accessed with Java api in Script Runner: 

def myToken = System.getenv('MY_ENVIRONMENT_VARIABLE_API_KEY')

This solution made sense for my use case because I already had other dev/staging/production type variables for other non Atlassian Docker images stored in my Docker compose ".env" files for specific environments. Once the variables are into the Docker container for the Atlassian JIRA instance, JIRA can read them.

Like Arthur likes this

I think the 'Script Variables' feature is only available in ScriptRunner Cloud. 

When you compare the server docs and cloud docs you see that only in the cloud docs there is the 'Script Variables' menu section on the left.

server docs:

cloud docs:


however, here are some workarounds for the server (look at the last comments):

0 votes
tom lister Community Leader Mar 10, 2019

Hi @Jean Rodriguez 

Go into the Add-ons part of JIRA Administration and in the left sidebar there should be a sub-heading SCRIPTRUNNER with one of the subsections being Script Variables. For a Cloud instance, the exact URL should be something like this:


I use scriptrunner in jira software into my localhost:8080, and there isn't Script Variables. Is there another solution?

Like Arthur likes this

I have this problem too! Where is this field? 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

59 views 0 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you