Shankar Daitha
Shankar Daitha

Reputation: 243

How to read string variable in Jenkins pipeline script under post block

How to read string variable in Jenkins pipeline script under post block

We created a Jenkins job to run our automation scripts. I am able to read the string parameter in Jenkins pipeline script but I am not able to read in pipeline script post block.

String parameter. enter image description here

Pipeline script - Post blog.

enter image description here

How to replace the highlighted value with string parameter in post block.

I am able to read the parameter using the %projectName% in the pipeline script. But the same is not working in post block.

Upvotes: 0

Views: 431

Answers (1)

Sers
Sers

Reputation: 12255

You can use params.projectName inside ${} in double quoted string:

cucumber fileIncludePattern: '0.json', jsonReportDirectory: "C:/testing/newproject/domain/${params.projectName}/target"

Upvotes: 1

Related Questions