Due to some maintenance issues, this service has been switched in read-only mode, you can find more information about the why

and how to migrate your plugin documentation in this blogpost

Skip to end of metadata
Go to start of metadata

A Jenkins plugin which allows users with config permission to define properties for a folder which can then be used by any jobs contained within it or any of its sub-folders. 

You can find this plugin's source code on Github.

Plugin Information

View Folder Properties on the plugin site for more information.


About this Plugin

The aim here is to remove the need to specify the same properties over and over again for all the jobs inside a folder.

In structures where two or more folders are nested, any property defined for a folder will be overridden by any other property of the same name defined by one of its sub-folders.

Configuring Folder Properties

Just create a folder, go to its configuration page and add as many properties as you need under the Folder Properties section.

Freestyle Jobs

Freestyle jobs must opt into the Folder Properties build wrapper from the Build Environment section of their configuration page in order to be able to access these properties as they would any other environment variable.

Pipeline Jobs

Pipeline jobs can use step withFolderProperties to access them:

Using folder properties in a pipeline job
    echo("Foo: ${env.FOO}")

Jenkins deployments using some of the older versions of the Structs Plugin will need to do this using the wrap meta-step:

Using folder properties in older pipeline jobs
wrap([$class: 'ParentFolderBuildWrapper']) {
    echo("Foo: ${env.FOO}")


In Job DSL scripts you can define folder properties like so:

Job DSL example
folder('my folder') {
    properties {
        folderProperties {
            properties {
                stringProperty {


  1. Unknown User (hagitsegev)


    I have a folder, with some pipelines. I use the same pipelines for different branches, and I have some different definitions on the SCM.

    I want to have a folder property, with the branch name, so I can use it to define the "branches to build" on the pipeline definition.
    I see that on "free style" jobs, I can mark a checkbox to use folder properties, but on pipelines, I have to use "withFolderProperties".

    Is it possible to set an option to use folder properties to define the pipeline?

    In this picture, I want to define "RELENG_BRANCH" on the folder level.


    1. Unknown User (mig82)

      I don't believe that will work. The way this plugin works for pipeline jobs is by extending SimpleBuildWrapper, which means the properties of the job's ancestor folders get added to env at runtime. Meanwhile, as far as I understand, the evaluation of the environment variables used for the configuration screen happens before the job starts running.

      As an alternative you could use some pipeline code to abort the build if the branch to be built doesn't match the RELENG_BRANCH variable you've defined for the folder –e.g.:

      Boolean abort = false
      stage('Validate branch'){
              //Let's determine which branch is being built.
              def cmd = 'git name-rev --name-only HEAD > branch'
              def branch = readFile('branch').trim()
              echo("Branch is '${branch}'")
              //Let's see if the branch to be built matches the config for this folder.
                  abort = branch != env.RELENG_BRANCH
      //This must be top-level to abort the job.


      I hope this helps.

  2. Unknown User (hagitsegev)

    Thanks Miguelángel Fernández and sorry for the late response.
    Indeed my original idea didn't work.

    I used your idea, but took it to another direction: I set the properties according branch (not abort).

  3. Unknown User (hagitsegev)

    Is it possible to use folder defined properties on SCM section?
    The "folder properties" check box is in the "build environment" sction, which is after the scm definition.

    I have a "trial" build that echo the value of the property, and works fine, When I try to use the same property on SCM section, I get an error, in which the name pf the property appears, and not the value:

    git rev-parse refs/heads/$folder_version^{commit} # timeout=10
       ERROR: Couldn't find any revision to build. 

    I posted more details and screen captures on https://serverfault.com/questions/935470/jenkins-folder-propery-is-it-possible-to-use-a-folder-defined-property-on-scm-s
    1. Unknown User (mig82)

  4. Unknown User (jaystan)

    Is there a REST command I can use to get and update the properties of a folder?

    1. Unknown User (jaystan)

      curl -u username:password -X GET https://jenkins-url.com/job/Folder1/config.xml -o folder.xml

  5. Unknown User (arunanappindi)


    I am trying to use this plugin in creating a SEED JOB which will internally trigger chain of jobs inside a PROJECT folder to create upstream/downstream dependencies.

    folder('PROJECT') {
        properties {
           folderProperties {
              properties {
                 stringProperty {

    I know that to inject folder properties in job, "FOLDER PROPERTIES" has to be checked in the job properties. How do inject the folder properties plugin in my job using DSL script?

    job("PROJECT/Example") {
       logRotator {

    // I tried using the below snippet but job executes without any error and when I open the job created it does not contain any Build Step or Post build step mentioned below.
     environmentVariables {
         contributors {

     steps {
       publishOverSsh {
              server('Test') {
                    transferSet {
                        execCommand('''COMMANDS TO EXECUTE ON SOME MACHINE SERVER")

     publishers {
            textFinder(/^FAIL/,'' ,true, false, true)

    I cannot manually select the check box since I am creating about 100 jobs in a folder with upstream/downstream dependencies.

    Need a solution to resolve this issue through script only.

    Appreciate the quick response.

  6. Unknown User (jcompagner)

    When reading in the SCM plugin i got this:

      It is also possible to use environment variables. In this case the variables are evaluated and the result is used as described above.
      E.g. ${TREEISH}, refs/tags/${TAGNAME},...

    so you can use env variables in the "Branches to build", but this properties plugin doesn't really set those kind of variables before everything?

    because doing ${xxxx} doesn't really work (just as i guess explained above and here: https://serverfault.com/questions/935470/jenkins-folder-propery-is-it-possible-to-use-a-folder-defined-property-on-scm-s )

     But this would be the number one reason to use this plugin... I guess i have the same as Hagit and a multiply folders with 1 folder having many projects that all have a common branch (per folder)

    So it would be great if this plugin could expose those properties to the jobs inside the folder the same as ENV_VARIABLES ...

    Also the "use custom workspace" option is not working, which is also used quite a bit in our jobs to point them to the "right branch"

    so for now out of the 3 (Use branch, Use custom workspace and Execute shell) only the last is working,