DEV Community 👩‍💻👨‍💻

Alexei Moussatov
Alexei Moussatov

Posted on

Howto: Drop-down list for values in Jenkins

How to create drop-down list in Jenkins with predefined items.


Step 1: create in Global properties at property with name PROJECTS and comma-separated list of your projects

Step 2: In job configuration add parameter Extended choice parameter
Set name for your parameter (for example JIRA_PROJECT)
Select Groovy script and add next groovy-code

    import jenkins.model.*
    nodes = Jenkins.instance.globalNodeProperties
    envVars = nodes[0].envVars
    return "${envVars['PROJECTS']}".split(',')

Step 3: Enjoy!

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git