How to define LabelParameterValue in Jenkinsfile

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to define LabelParameterValue in Jenkinsfile

Kai Wang

I have two jobs A and B. Job A calls Job B like this

build job: "B", parameters[[$class: 'LabelParameterValue', name: 'node', label: "${env.NODE_NAME}"]]

I know I am supposed to add a Label parameter in B. But the problem is B is a multiple branch pipeline project defined by Jenkinsfile.

So the question is, how do I define a Label parameter in Jenkinsfile? I tried 

parameters {
        LabelParameterValue(name: 'node', label: '')

But I got the error:

WorkflowScript: 11: Invalid parameter type "Label". Valid parameter types: [booleanParam, choice, credentials, file, text, password, run, string] @ line 11, column 9.
           Label(name: 'node', label: '')

Thanks for the help.

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit
For more options, visit