Skip to content

[JENKINS-28380] Give expression examples for restricting where builds can run #21113

Closed

Description

@jenkins-infra-bot

For the check-box "Restrict where this project can be run," there is nothing in the help that mentions what kind of expressions you can write.

From trial and error, I deduced that "a || b" means "use either a or b as build nodes." I expected a comma, like other fields (eg. projects that can access archives, projects to run after this build, etc.) I'm sure there are other valid expressions, such as using "*".

Can you please update the help for this field to include some examples? I ended up looking at the source on GitHub and guessed this from the use of Antlr.


Originally reported by ashes999, imported from: Give expression examples for restricting where builds can run
  • status: Open
  • priority: Minor
  • component(s): core
  • label(s): jenkins, newbie-friendly, user-experience
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-11-24
Raw content of original issue

For the check-box "Restrict where this project can be run," there is nothing in the help that mentions what kind of expressions you can write.

From trial and error, I deduced that "a || b" means "use either a or b as build nodes." I expected a comma, like other fields (eg. projects that can access archives, projects to run after this build, etc.) I'm sure there are other valid expressions, such as using "*".

Can you please update the help for this field to include some examples? I ended up looking at the source on GitHub and guessed this from the use of Antlr.

  • environment: Jenkins ver. 1.609. I don't know the JRE or OS, sorry (my guess in Windows OS) because I don't manage these machines.

Activity

  1. jenkins-infra-bot commented on May 18, 2015

    @jenkins-infra-bot
    Author
    danielbeck:
    • Original comment link
    • Raw content of original comment:

      I'm fairly sure this help existed.

    I'm fairly sure this help existed.

  2. adityasah104 commented on Dec 23, 2025

    @adityasah104

    Is this issue still active?

  3. MarkEWaite commented on Jul 20, 2026

    @MarkEWaite
    Contributor

    The original comment from the issue report seems incorrect to me. It says:

    For the check-box "Restrict where this project can be run," there is nothing in the help that mentions what kind of expressions you can write.

    The help exists and the examples exist. The existing help for "Restrict where this project can be run" states how to find the help. The help text says:

    The help text for the Label Expression field, shown when this option is checked, provides more detailed information on how to specify agent criteria.

    The user can see the existing help with these steps in the "Configure" page of a freestyle project:

    1. Open help of the "Restrict where this project can be run" checkbox

    Image

    2. Check the "Restrict where this project can be run" checkbox to see the help for that field, including the phrase:

    The help text for the Label Expression field, shown when this option is checked, provides more detailed information on how to specify agent criteria.

    Image

    3. Expand the help for the "Label expression" field

    Image

    Two additions are proposed to the existing text in pull request:

    Those two additions do not address the first sentence in the description of this issue because the description is incorrect. The help is available. It is attached to the "Label expression" field instead of being attached to the "Restrict where this project can be run" field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions