Job A isn't really setting VAR_REV. Instead, it's setting it in a local
scope (ie it shells out, sets the env var in that shell, then exits the
shell). Try using the Inject Environment Variable plugin.

On Wed, Mar 30, 2016 at 3:52 PM nguyen <[email protected]> wrote:

> Hi,
>
> I have two  build job *A* and *B*.
> job *A *build by "Execute Windows Batch Command"
> job *B* build by "Flow"
>
> In job *A*, I set "This build is parameterized" -> String Parameter ->
> Name = VAR_REV and Default = 123
> In job *A*  "Execute Windows Batch Command", I set as below
>
> echo %VAR_REV%
> set VAR_REV=456
> echo %VAR_REV%
> exit 0
>
> In job *A*, I set "Post-build Actions"->"Trigger Parameterized build on
> other project" -> "Project to build" = *B* and "Current Build Parameter"
>
> In job *B* "Flow", I set
>
> def REV= build.environment.get("VAR_REV")
> println REV
>
>
> After I build job *A*, I have output of first echo of job A is 123 and
> output of second echo of job *A* is 456.
> However, the output at job *B* is printing out 123.
>
> What should I do to have the data 456 in job *B*?
>
> Thanks,
>
> Nguyen
>
> --
> 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/f6fe67fe-b94a-4794-ae1a-aec125650d75%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/f6fe67fe-b94a-4794-ae1a-aec125650d75%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 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/CALa_nQk7RKXE7cvt5hKKByr-b01ov%3DSwvNKBCar%3DjkBQSm2%2BPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to