#1. try unclicking "Use Groovy sandbox" at the bottom of the script window.

#1 and #2 could be you don't have permissions. I am an admin of my jenkins
master


On Wed, Jun 28, 2017 at 1:13 PM, Stanley Shen <[email protected]>
wrote:

> Thanks for replying.
>
> I tried solution #1 you provided, but it report error like
> "org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException:
> Scripts not permitted to use method”
>
> For #2, it also report error like “org.jenkinsci.plugins.
> scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to
> use staticMethod jenkins.model.Jenkins getInstance”
>
>
> Any idea on it.
>
>
> Regards,
> Stanley
>
>
>
>
>
>
> On Jun 28, 2017, at 8:04 PM, Richard Ginga <[email protected]>
> wrote:
>
> The things you "can" get from the returned object (c) from a pipeline
> statement like: c = build job: "test job1" are here:
>
> https://github.com/jenkinsci/workflow-support-plugin/blob/
> master/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/
> RunWrapper.java
>
> you might be able to do something with the non-whitelisted getRawBuild
> method.
>
> Otherwise, to get that job's env variables you must do something "like"
> this: (untested)
>
> Jenkins.instance.getItemByFullName("test job1").getAllJobs()[0].
> getLastSuccessfulBuild().getEnv("uuid")
>
> On Tue, Jun 27, 2017 at 9:21 PM, <[email protected]> wrote:
>
>> Hello, all
>>
>> I am trying to trigger a freestyle job in pipeline and need to get a
>> inject environment from that job.
>> Before with flow job, we can use thing like
>>
>> c = build("test job1")
>> uuid = c.build.properties["environment"]["uuid"]
>>
>> But I didn't find a way to do this similar in pipeline script.
>>
>> Is there any hint on it?
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Jenkins Users" 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/ms
>> gid/jenkinsci-users/fa73e7a7-ea85-4eee-8f8e-037689bff630%
>> 40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/fa73e7a7-ea85-4eee-8f8e-037689bff630%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Dick Ginga
> Build Engineer
> [email protected]
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jenkinsci-users/ouDKTknbt7k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/CAL3PpaVGzRL2j_rNYAhAsSPxw2F8gpotuLhpZiA3DOjk
> YXgDUw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAL3PpaVGzRL2j_rNYAhAsSPxw2F8gpotuLhpZiA3DOjkYXgDUw%40mail.gmail.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 Users" 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-users/50176E3F-E26F-413E-A4E3-
> E69195EE0021%40servicemax.com
> <https://groups.google.com/d/msgid/jenkinsci-users/50176E3F-E26F-413E-A4E3-E69195EE0021%40servicemax.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Dick Ginga
Build Engineer
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" 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-users/CAL3PpaV%2B6stTpw5P6HPftn9tgGrvKki%2Be%3DPYjxxDK%2BTGJM%2Bv4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to