Home:ALL Converter>How to use freestyle project parameters in a Pipeline Project?

How to use freestyle project parameters in a Pipeline Project?

Ask Time:2020-07-17T07:15:54         Author:Milad Tabrizi

Json Formatter

I have an old freestyle project, and now trying to write a Jenkins file to run another job. But I need to use some parameters from the old one. I tried different solution from documentation, none of them worked.

Q: How can I retrieve the old freestyle project parameters and use it in my Jenkins file?

The version is setting in the old one.in new one i have:

parameters { string(name: 'Version', defaultValue: '', description: 'test') 
string(name: 'JOBNAME', defaultValue: '', description: 'test') } .

Now I want to default value get set from the old freestyle job.

Author:Milad Tabrizi,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62944849/how-to-use-freestyle-project-parameters-in-a-pipeline-project
yy