1

I have a pipeline project say "A" which is string parameterized, and I am trying to call another build say "B" which is also string parameterized, using the command as follows :

build job: 'B', parameters: [[$class: 'StringParameterValue', name: 'tagg', value: "$env.tag"]]

The target is used to pass the parameter which was taken as input from A and assign use it in B.I tried to receive the parameter echo "$env.tagg" which gave null, echo "$tagg" gave no such parameter found error.

So how do I receive the parameters sent from A in B.

1 Answer 1

1

I think you need to let Jenkins know what env.tag is, try something like:

build job: 'B', parameters: [[$class: 'StringParameterValue', name: 'tagg', value: String.ValueOf($env.tag)]] 
Sign up to request clarification or add additional context in comments.

2 Comments

It is giving the following error:groovy.lang.MissingPropertyException: No such property: $env for class: groovy.lang.Binding
Please post your whole Jenkinsfile

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.