You should really think through what you want and always keep the jobs 
hierachically ordered. To accomplish what  you want you need an explict 
trigger Job1 step (maybe a plugin is needed for freestyle builds). But 
beware that if you also have a trigger in job2 that triggers after job1 
success, then you may easily create an endless loop....




[email protected] schrieb am Montag, 20. Dezember 2021 um 06:12:44 UTC+1:

> Hi,
>
> Requirment is to trigger the upstream job( freestyle jobs). Can anyone 
> please help in this.
>
>
> On Fri, 17 Dec 2021, 8:10 pm , <[email protected]> wrote:
>
>> Hi Adharsha,
>>
>> We don’t use freestyle, so I may not be the best person to help you.
>>
>> I’m struggling although to understand the logic you want to implement.
>>
>> You said that in the “second job” configuration you configured “build 
>> trigger” and selected “first job”.
>>
>> But then you said you click “Build Now” on the “second job”.
>>
>> That is not how the “build trigger” works.
>>
>> On the basis of your configuration, it’s when you click “Build Now” on 
>> the “first job” that the “second job” will be triggered if the “first job” 
>> succeed.
>>
>>  
>>
>> Probably you got confused by the difference in English between “build 
>> trigger” and “trigger build” 😉 I get confused many times too.
>>
>>  
>>
>> So, if you want that “second job” trigger build of “first job” then you 
>> need to configure a “build trigger” on the “first job” mentioning the 
>> “second job”.
>>
>>  
>>
>> I hope that is what you are looking for.
>>
>>  
>>
>> Cheers,
>>
>> Gianluca.
>>
>>  
>>
>>  
>>
>> *From:* [email protected] <[email protected]> *On 
>> Behalf Of *Adharsha sri
>> *Sent:* 17 December 2021 14:10
>> *To:* [email protected]
>> *Subject:* Re: Trigger upstream job
>>
>>  
>>
>> Hi, 
>>
>> We created 2 freestyle jobs( first job, second job) and we have mentioned 
>> first job in *build trigger - build after other projects are build( if 
>> build is stable) * in second job configuration. When we click  buildnow 
>> in second job , it need to trigger first job and if it is 
>> successfully completed then the second job should run, but it is not 
>> happening.
>>
>>  
>>
>> Thanks, 
>>
>> Adharsha.
>>
>>  
>>
>>  
>>
>> On Fri, 17 Dec 2021, 7:19 pm , <[email protected]> wrote:
>>
>> Hi Adharsha,
>>
>> We use this in our pipeline and works:
>>
>>  
>>
>> def job = build([
>>     *job*: “Job/name”,
>>     *wait*: *true*,
>>     *propagate*: 
>> *false*])
>>
>>  
>>
>> What are the errors that you are experience on doing it?
>>
>> Can you add more details?
>>
>>  
>>
>> Cheers,
>>
>> Gianluca.
>>
>>  
>>
>> *From:* [email protected] <[email protected]> *On 
>> Behalf Of *Adharsha sri
>> *Sent:* 17 December 2021 13:46
>> *To:* [email protected]
>> *Subject:* Trigger upstream job
>>
>>  
>>
>> Hi Team,
>>
>>  
>>
>> Need to trigger the upstream job from the run downstream job.
>>
>>  
>>
>> We are able to trigger the down stream job from upstream job but not in 
>> reverse direction.  Can you please help us.
>>
>>  
>>
>> Requirement:
>>
>>  
>>
>> First job <-- Second job
>>
>>  
>>
>> When I run second job it should trigger upstreamjob (I.e. first job). And 
>> first job should be independent.
>>
>>  
>>
>> Thanks,
>>
>> Adharsha.
>>
>>  
>>
>>  
>>
>> -- 
>> 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/CAJWGB6q%3DZ7c0ei39cuYqqDjYUowBp0A_rk3TGqqrCpQD_LOvbQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/CAJWGB6q%3DZ7c0ei39cuYqqDjYUowBp0A_rk3TGqqrCpQD_LOvbQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> 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/00c401d7f34c%24eebc7070%24cc355150%24%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/00c401d7f34c%24eebc7070%24cc355150%24%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> 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/CAJWGB6rn8ZSsWTGSph3Gkv%2BkkCUHQDykZ1knvhLiOysfU3b3cQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/CAJWGB6rn8ZSsWTGSph3Gkv%2BkkCUHQDykZ1knvhLiOysfU3b3cQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> 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/00d501d7f353%24fd9207c0%24f8b61740%24%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/00d501d7f353%24fd9207c0%24f8b61740%24%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/293d95aa-684c-4978-9ae2-8a39f8573048n%40googlegroups.com.

Reply via email to