-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get the value of the build parameter ? #34
Comments
job = jk.get_job('test') result: the result is a variable('value': '${commit}')? |
to get parameters of build with following code paramters = build.get_parameters() |
try following code params = []
for p in job.api_json()['property']:
if 'parameterDefinitions' in p:
params = p['parameterDefinitions'] but for your case, the "${commit}" is variable which will be evaluated during building, so you can't get an exact value for job. |
Run the above code, the result is still "${commit}". Is there another way? |
No, because the "${commit}" is bundled with build not the job |
OK, thanks for your answer |
Sorry, it was caused by my jenkins configuration error. Using job.api_json can get the value correctly 、 Return: |
jenkins api:
http://xxxxxx/job/test/descriptorByName/net.uaznia.lukanus.hudson.plugins.gitparameter.GitParameterDefinition/fillValueItems?param=
result:
{"_class":"net.uaznia.lukanus.hudson.plugins.gitparameter.model.ItemsErrorModel","errors":[],"values":[{"name":"4b91af67 2020-10-25 18:11 xxxxx xxxxxxx@xxxx.com 1. xxxxxxxxxxxxxxxxxxxx","value":"4b91af1111115df6212f1fdsfdsaf4223826f43434"}]}
The text was updated successfully, but these errors were encountered: