Assuming you have the current build project, It might be included in 
build.getParent().getProperties() 
https://javadoc.jenkins.io/hudson/model/Job.html#getProperties--



From: 'Jordan Vogel' via Jenkins Developers <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Wednesday, June 5, 2019 at 10:02 AM
To: Jenkins Developers <[email protected]>
Subject: Accessing parameter values form a different plugin

Notice: This email is from an external sender.


Hey, so I am trying to access the variable of the job parameter which comes 
though the Parameterized Build Jobs plugin. This variable is passed in through 
the URL of the script that triggers the job. I am writing a custom plugin to 
have some settings changes based on the parameter the job gets passed in. I, 
for the life of me, can't seem to access the variable, and I am thinking this 
is because it is a variable that comes from another plugin, not inherent to 
jenkins.

I have tried System.getEnv(EnvVar), and System.getProperty(EnvVar) both to no 
avail, I have even tried to get an Array of all parameters, all of these return 
null.

Does anyone know how this is done? Do I have to change functionality in the 
Parameterized Build Jobs plugin (not ideal). Or how can I access a job 
parameter passing in from the above plugin, from a separate plugin?

Thanks
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/2637a384-e218-45e1-af1b-2951708a2f09%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-dev/2637a384-e218-45e1-af1b-2951708a2f09%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/AE5FB6F5-A7F4-47FD-8BD7-7F526F2DA3BF%40godaddy.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to