[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread de...@ikedam.jp (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 ikedam updated  JENKINS-61265  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Chris Fouts Because the extensible-choice runs when a build is scheduled, not when starts. It has nothing to do with the `wait` parameter. Here is an issue tracker, not your support center nor stackoverflow. Please don't reopen closed ticket without any concrete evidences, like log outputs. I believe you can verify what happen easily with removing the `if` statement.  
 

  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 ikedam  
 
 
Status: 
 Reopened Fixed but Unreleased  
 
 
Resolution: 
 Incomplete  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 
   

[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts edited a comment on  JENKINS-61265  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
 But Job1 has already finished running  by the time Job2 runs  because the {{wait}} parameter in the {{build()}} call is set to {{false}}?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.204836.1582850363000.1138.1582863780143%40Atlassian.JIRA.


[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts commented on  JENKINS-61265  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
 But Job1 has already finished running because the wait parameter in the build() call is set to false?  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.204836.1582850363000.1135.1582863720432%40Atlassian.JIRA.


[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts assigned an issue to Unassigned  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 Chris Fouts  
 
 
Assignee: 
 Chris Fouts  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.204836.1582850363000.1132.1582863720391%40Atlassian.JIRA.


[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts updated  JENKINS-61265  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 Chris Fouts  
 
 
Resolution: 
 Not A Defect  
 
 
Status: 
 Fixed but Unreleased Reopened  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.204836.1582850363000.1133.1582863720405%40Atlassian.JIRA.


[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts commented on  JENKINS-61265  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
 Here's Job2's Extensible Choice Groovy script 

 

import hudson.model.*
 
BUILD_JOB_NAME = "Utilities/Playground/Job1"
 
def getBuildJob() {
def buildJob = null
Hudson.instance.getAllItems(Job.class).each {
if (it.fullName == BUILD_JOB_NAME) {
buildJob = it
}
}
return buildJob
}
 
List getAllBuildNumbers(Job job) {
List buildNumbers = []
(job.getBuilds()).each {
def status = it.getBuildStatusSummary().message
if (status.contains("stable") || status.contains("normal")) {
buildNumbers.add(it.displayName)
}
}
return buildNumbers
}
 
Job buildJob = getBuildJob()
List buildNumbers = null
if (buildJob) {
  buildNumbers = getAllBuildNumbers(buildJob)
}
return buildNumbers
 

  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 Chris Fouts  
 
 
Comment: 
 Here's Job2's Extensible Choice Groovy script{code:java}import hudson.model.* BUILD_JOB_NAME = "Utilities/Playground/Job1" def getBuildJob() {def buildJob = nullHudson.instance.getAllItems(Job.class).each {if (it.fullName == BUILD_JOB_NAME) {buildJob = it}}return buildJob} List getAllBuildNumbers(Job job) {List buildNumbers = [](job.getBuilds()).each {def status = it.getBuildStatusSummary().messageif (status.contains("stable") || status.contains("normal")) {buildNumbers.add(it.displayName)}}return buildNumbers} Job buildJob = getBuildJob()List buildNumbers = nullif (buildJob) {  buildNumbers = getAllBuildNumbers(buildJob)}return buildNumbers{code}  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 

[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread de...@ikedam.jp (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 ikedam assigned an issue to Chris Fouts  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 I failed to change the assignee. Please see the previous comment.  
 

  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 ikedam  
 
 
Assignee: 
 ikedam Chris Fouts  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.204836.1582850363000.1100.1582854120155%40Atlassian.JIRA.


[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread de...@ikedam.jp (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 ikedam updated  JENKINS-61265  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 
 
Because the build of Job1 is still running at that time. I believe getBuildStatusSummary() returns “?” 
 
https://github.com/jenkinsci/jenkins/blob/jenkins-2.164.3/core/src/main/java/hudson/model/Run.java#L2151 
https://github.com/jenkinsci/jenkins/blob/jenkins-2.164.3/core/src/main/resources/hudson/model/Messages.properties#L246 
  
And I recommend you not to use getBuildStatusSummary() as its output may be localized and changes for languages. 
I could not get what you wanted to do with passing StringParameterValue. I believe it does nothing. 
  
 

  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 ikedam  
 
 
Status: 
 Open Fixed but Unreleased  
 
 
Resolution: 
 Not A Defect  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 Chris Fouts  
 
 
Attachment: 
 Screen Shot 2020-02-27 at 8.36.13 PM.png  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.204836.1582850363000.1094.1582853940300%40Atlassian.JIRA.


[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 Chris Fouts  
 
 
Attachment: 
 Screen Shot 2020-02-27 at 8.34.53 PM.png  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.204836.1582850363000.1092.1582853940275%40Atlassian.JIRA.


[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 Chris Fouts  
 
 
Attachment: 
 Screen Shot 2020-02-27 at 7.29.52 AM.png  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.204836.1582850363000.1078.1582850520259%40Atlassian.JIRA.


[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Change By: 
 Chris Fouts  
 

  
 
 
 
 

 
 I have 2 Jenkins jobs, Job1 and Job2, and Job1 triggers Job2 via this pipeline DSL{code:java}node('someNode') { stage('Call Job2') {   build job: 'Job2', parameters: [   new StringParameterValue('ExtensibleChoiceParam', 'TARGET_VERSION') ], wait: false }}{code}  Job2 has this Groovy script as its Extensible Choice Parameter for variable  \ {{TARGET_VALUE ,  }} , which provides a list of ALL successful builds for Job1{code:java}// code placeholderimport hudson.model.* BUILD_JOB_NAME = "Job1" def getBuildJob() {def buildJob = nullHudson.instance.getAllItems(Job.class).each {if (it.fullName == BUILD_JOB_NAME) {buildJob = it}}return buildJob} List getAllBuildNumbers(Job job) {List buildNumbers = [](job.getBuilds()).each {def status = it.getBuildStatusSummary().messageif (status.contains("stable") || status.contains("normal")) {buildNumbers.add(it.displayName)}}return buildNumbers} Job buildJob = getBuildJob()List buildNumbers = nullif (buildJob) {  buildNumbers = getAllBuildNumbers(buildJob)}return buildNumbers{code}Job2 does nothing but prints TARGET_VERSION, so it just does this{code:java}node('someNode') {  stage('Print TARGET_VERSION') {println "TARGET_VERSION: $TARGET_VERSION"  }}{code}If Job1 has the following build history for example,{noformat}Build#    Status$4Success#3Fail#2Success#1Fail{noformat} If I click on Job2's Build with parameters link, I get the correct list, that is, as shown below, so I know the script is correct.{noformat}#4#2{noformat}  When Job1 triggers Job2 (per Job1's pipeline DSL above), I expect Job2 to print {{#4}}, Job1's latest successful build. However, it prints out {{#2}}, the previous successful build. Why?   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
  

[JIRA] (JENKINS-61265) Job with Extensible Groovy script does NOT get latest value when triggered by another job

2020-02-27 Thread zill...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Chris Fouts created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61265  
 
 
  Job with Extensible Groovy script does NOT get latest value when triggered by another job   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 ikedam  
 
 
Components: 
 extensible-choice-parameter-plugin  
 
 
Created: 
 2020-02-28 00:39  
 
 
Environment: 
 Jenkins v2.164.3  Extensible Choice Parameter plugin v1.6.0  
 
 
Priority: 
  Critical  
 
 
Reporter: 
 Chris Fouts  
 

  
 
 
 
 

 
 I have 2 Jenkins jobs, Job1 and Job2, and Job1 triggers Job2 via this pipeline DSL 

 

node('someNode') {
 stage('Call Job2') {
   build job: 'Job2',
 parameters: [
   new StringParameterValue('ExtensibleChoiceParam',
'TARGET_VERSION')
 ],
 wait: false
 }
} 

   Job2 has this Groovy script as its Extensible Choice Parameter for variable {{TARGET_VALUE, }}which provides a list of ALL successful builds for Job1 

 

// code placeholder
import hudson.model.*
 
BUILD_JOB_NAME = "Job1"
 
def getBuildJob() {
def buildJob = null
Hudson.instance.getAllItems(Job.class).each {
if (it.fullName == BUILD_JOB_NAME) {
buildJob = it
}
}
return buildJob
}
 
List getAllBuildNumbers(Job job) {
List buildNumbers = []
(job.getBuilds()).each {
def status = it.getBuildStatusSummary().message