I have been handed over a parameterized pipeline job which has default value set to String A, now I have been asked to set this default value to String B. I configured String B in the default value text box and saved the job. This job is scheduled one so when this job is triggered by system it runs with String A instead of String B (I was expecting it to run with String B) and on UI too the default value is changed to String A. Why is this behaviour? Do i need to change the parameter default value in Jenkinsfile?
Hi there! I can't be sure without seeing the code but my guess is yes. Parameter declarations in the jenkinsfile overwrite the ones in the job signature. There's an alternative solution too, see here.
Hi, it worked after making changes in the jenkinsfile.
Jenkinsfile is hosted on github repo which is being check-out at the time of job run. We are able to run with required default values after changing them in Jenkinsfile.
Thanks a lot for this article and help.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have been handed over a parameterized pipeline job which has default value set to String A, now I have been asked to set this default value to String B. I configured String B in the default value text box and saved the job. This job is scheduled one so when this job is triggered by system it runs with String A instead of String B (I was expecting it to run with String B) and on UI too the default value is changed to String A. Why is this behaviour? Do i need to change the parameter default value in Jenkinsfile?
Hi there! I can't be sure without seeing the code but my guess is yes. Parameter declarations in the jenkinsfile overwrite the ones in the job signature. There's an alternative solution too, see here.
I will post the screen shots later today however I think you are right changing the Jenkins file will work for me.
Hi, it worked after making changes in the jenkinsfile.
Jenkinsfile is hosted on github repo which is being check-out at the time of job run. We are able to run with required default values after changing them in Jenkinsfile.
Thanks a lot for this article and help.