Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

XL Release Tutorial: Variables

Using a List variable as a value in the List box variable types

You can create a List variable and use it as a possible value for a List box variable.

  1. Create a global variable or a release variable with the type List.
  2. When you create a new variable and select the type List box, click the button next to the Possible values to switch between a list of normal values or a variable of type List.List box variable
  3. Select the second option and choose a List type variable.
  4. Click Save.

You can use the List box variable in templates, releases, or tasks allowing users to select the values from predefined List variable.

Using lists of Applications or Environments in the List box variable types

You can choose a list of Applications or Environments to be used as possible values for a List box variable.

Please specify the run-as user and password on the template properties as those credentials will be used to retrieve the available Applications and Environments.

Note: Applications or environments will only be retrieved when the new release is being created and during the User Input task. In all other cases – such as manually changing variable values in either a Template or Release – the list of values will be empty.

Dynamically populating a List box variable type using a custom script

You can use a script to dynamically retrieve possible values inside a List box variable.

  1. Create a new List box variable.
  2. Select Value provider as the Value provider type.List box variable_with_value_provider
  3. Select the Script value provider.
  4. Depending on the selected script, you will have different input fields. The script will be evaluated when creating a release.
  5. Click Save.

Note: Applications or environments will only be retrieved when the new release is being created and during the User Input task. In all other cases – such as manually changing variable values in either a Template or Release – the list of values will be empty.

Creating a custom script value provider

Creating a new script value provider is similar to the Plugin tasks. For a more detailed explanation of how to extend the Release type system, see Defining a custom task.

Example script value provider

In the synthetic.xml file, you must extend xlrelease.JythonProvider or xlrelease.GroovyProvider:

<synthetic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.xebialabs.com/deployit/synthetic"
       xsi:schemaLocation="http://www.xebialabs.com/deployit/synthetic synthetic.xsd">

  <type type="test.Test2ValueProvider" extends="xlrelease.JythonProvider" label="Sample value provider with CI ref"
            description="This value provider has CI ref parameter that points to JIRA server.">
      <property name="jiraServer" label="JIRA server" referenced-type="jira.Server" kind="ci" description="JIRA server to use" />
      <property name="username"  required="false" description="Overrides the username used to connect to the server"/>
      <property name="password" password="true" required="false" description="Overrides the password used to connect to the server"/>
  </type>

</synthetic>Code language: HTML, XML (xml)

You can store value provider scripts in the ext or plugins directory of the Release server.

  • Use ext when you are developing a custom value provider. The ext directory contains custom type definitions in the synthetic.xml file. Scripts are placed in the subdirectories of ext.
  • The plugins directory contains bundled plugins that are packaged in a single zip file with the .jar extension.

For the value provider defined above, Release will try to find and execute the python script at this location: test/Test2ValueProvider.py. Value provider scripts must return a list of objects in the variable named result.

Note: The properties of the value provider will be injected into the script as well as a dictionary. As a result, you do not need to access the properties as valueProvider.jiraServer but use jiraServer, instead.

The following script can be used to display the title of the JIRA server passed as a parameter to the value provider defined above:

# let's connect to the provided jiraServer
from xlrelease.HttpRequest import HttpRequest
# example of request to the Jira server
req = HttpRequest(jiraServer)
# ...
result = [jiraServer["title"]]
# or
# result = [valueProvider.jiraServer.title]Code language: PHP (php)

You can add the following properties to the <type> element to further customize your value provider:

  • scriptLocation: Specifies a custom script location that overrides the default rules.

This is an example of a value provider that generates a range of numbers:

<synthetic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.xebialabs.com/deployit/synthetic"
       xsi:schemaLocation="http://www.xebialabs.com/deployit/synthetic synthetic.xsd">

    <type type="test.TestValueProvider" extends="xlrelease.JythonProvider" label="Sample script value provider"
          description="This value provider has two parameters for range.">
        <property name="param1" label="Lower bound" default="1" description="Minimum value." required="false" />
        <property name="param2" label="Upper bound" default="5" description="Maximum value." required="false" />
    </type>

</synthetic>

Place the corresponding script into test/TestValueProvider.py:
Code language: HTML, XML (xml)
def generateRange():
    t = range(long(valueProvider.param1), long(valueProvider.param2))
    return t

result = generateRange()Code language: JavaScript (javascript)

Refernce

  • https://docs.digital.ai/bundle/devops-release-version-v.22.2/page/release/how-to/configure-global-variables.html

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Top 10 AI Infographic Creators Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI infographic creators have become essential tools for businesses, marketers, educators, and content creators who need to transform complex data into visually compelling stories….

Read More

Top 11 AI Personalized Learning Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI personalized learning tools have transformed education and training, tailoring content to individual learner needs with unprecedented precision. These tools leverage machine learning, natural…

Read More

Top 10 Accounting Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, the importance of accounting software continues to grow, helping businesses of all sizes streamline financial management, improve accuracy, and stay compliant with ever-changing regulations….

Read More

Top 10 Endpoint Management Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, businesses of all sizes are increasingly reliant on a variety of devices—laptops, desktops, mobile devices, and other endpoints—that connect to their networks. With the…

Read More

Top 10 Order Management Systems Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, managing orders has become a sophisticated process, requiring advanced tools to handle large volumes, multiple sales channels, and intricate supply chains. Order Management Systems…

Read More

What is Veracode and use cases of Veracode?

What is Veracode? Veracode is a leading application security (AppSec) platform that helps organizations identify and remediate vulnerabilities in their software throughout the development lifecycle. By integrating…

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
venkatesh
venkatesh
3 years ago

How do you add dynamic generated values like 1-10 and assign to the list box?

1
0
Would love your thoughts, please comment.x
()
x