Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43701

JIRA_ISSUES variable is empty in downstream jobs

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins v2.6.1
      jira-plugin v2.3
      delivery-pipeline-plugin v1.0.0
      OS: RHEL

      The JIRA_ISSUES variable is empty in downstream jobs past the first one.

      I'm trying to update the related issues as they flow through a series of chained downstream jobs. For Example: BUILD --> QA Deploy --> STAGING Deploy. I'm able to capture accumulated issues from multiple BUILD runs when running the first downstream job (QA Deploy) using the JIRA: Add related environment variables to build in the QA job and referencing the $JIRA_ISSUES variable. However, when I run the next downstream job (STAGING Deploy), $JIRA_ISSUES is empty.

      How can I capture the accumulated JIRA issues in a variable in the STAGING job just like it does in the QA job?

      STAGING Deploy job configuration:

       

        1. deliveryPipeline-issues.PNG
          deliveryPipeline-issues.PNG
          17 kB
        2. downstream-jobParameters.PNG
          downstream-jobParameters.PNG
          20 kB
        3. empty-jiraIssues.PNG
          empty-jiraIssues.PNG
          6 kB
        4. expect-jiraIssues-parameter.PNG
          expect-jiraIssues-parameter.PNG
          22 kB
        5. jira_plugin_empty_parameter.png
          jira_plugin_empty_parameter.png
          88 kB
        6. jira-issue-setup.PNG
          jira-issue-setup.PNG
          29 kB
        7. related-JIRA.PNG
          related-JIRA.PNG
          13 kB

          [JENKINS-43701] JIRA_ISSUES variable is empty in downstream jobs

          Tommy Tynjä added a comment -

          jlevis Have you used this functionality before and it has worked? Have you upgraded your Jenkins version recently? I noticed that the same thing happened to me when I upgraded Jenkins version. All of a sudden parameters were no longer propagated. In our case we assured that we declared every input parameter expected in every job configuration of the pipeline (so that they could be passed downstream) and that solved the problem, thus I did not see any relation to the functionality in the delivery pipeline plugin. Could you reproduce this with a simple pipeline with an example configuration?

          Tommy Tynjä added a comment - jlevis Have you used this functionality before and it has worked? Have you upgraded your Jenkins version recently? I noticed that the same thing happened to me when I upgraded Jenkins version. All of a sudden parameters were no longer propagated. In our case we assured that we declared every input parameter expected in every job configuration of the pipeline (so that they could be passed downstream) and that solved the problem, thus I did not see any relation to the functionality in the delivery pipeline plugin. Could you reproduce this with a simple pipeline with an example configuration?

          Joe Levis added a comment -

          Hi tommysdk,

          This is the first time I'm implementing something like this in Jenkins, so nothing to compare it to.

          I've tried passing the JIRA_ISSUES value as a Predefined parameter to the downstream jobs:

          Then having the downstream job expect the parameter:


          I think the question I'm looking to answer is "Can Jenkins update the related JIRA issues as they are reflected in the Delivery Pipeline view?" Which means, I'd need Jenkins jobs to be aware of aggregated tickets, not just the specific ones related to a single build. So that when multiple issues accumulate in the QA stage for example, they are all updated to "In Staging" when I push the latest build to the STAGING stage. I hope that makes sense?

          Joe Levis added a comment - Hi tommysdk , This is the first time I'm implementing something like this in Jenkins, so nothing to compare it to. I've tried passing the JIRA_ISSUES value as a Predefined parameter to the downstream jobs: Then having the downstream job expect the parameter: I think the question I'm looking to answer is "Can Jenkins update the related JIRA issues as they are reflected in the Delivery Pipeline view?" Which means, I'd need Jenkins jobs to be aware of aggregated tickets, not just the specific ones related to a single build. So that when multiple issues accumulate in the QA stage for example, they are all updated to "In Staging" when I push the latest build to the STAGING stage. I hope that makes sense?

          Joe Levis added a comment -

          Updated the Summary and Description for clarity, as I learn Jenkins terminology better.

          Any help on this is much appreciated. I've tried every way I can think of to get this to work and hit a roadblock.

           

          Thanks!

          Joe Levis added a comment - Updated the Summary and Description for clarity, as I learn Jenkins terminology better. Any help on this is much appreciated. I've tried every way I can think of to get this to work and hit a roadblock.   Thanks!

          Tommy Tynjä added a comment -

          jlevis I understand. As long as the expected parameters are declared as input parameters on one job and declared to be passed on to the downstream job (which in turn also expect them as input parameters) it should work as expected. Does it make any difference if you use the same case (e.g. all upper case) for the variables throughout all job configurations?

          Tommy Tynjä added a comment - jlevis I understand. As long as the expected parameters are declared as input parameters on one job and declared to be passed on to the downstream job (which in turn also expect them as input parameters) it should work as expected. Does it make any difference if you use the same case (e.g. all upper case) for the variables throughout all job configurations?

          Joe Levis added a comment - - edited

          tommysdk - Thanks for the reply!

          I've tried both ways. I've tried using $JIRA_ISSUES. I've tried specifying a specific parameter like: qa_jira_issues=$JIRA_ISSUES. Then passing that to the next downstream job. Neither have worked.

          I think the problem is that JIRA_ISSUES is only recognized by the first job and its immediate downstream. If the first downstream job triggers another downstream job, we lose the JIRA_ISSUES value.

          The goal is that we're trying to replicate the functionality that the first downstream job has in detecting all JIRA issues accumulated from multiple upstream builds, and have that do the same when the first downstream job triggers the next downstream job.

           

          Ultimately, have this:

          Detect the diff of JIRA issues coming into it's environment, no matter where in the chain of downstream jobs it is.

          Joe Levis added a comment - - edited tommysdk - Thanks for the reply! I've tried both ways. I've tried using $JIRA_ISSUES . I've tried specifying a specific parameter like: qa_jira_issues=$JIRA_ISSUES . Then passing that to the next downstream job. Neither have worked. I think the problem is that JIRA_ISSUES is only recognized by the first job and its immediate downstream. If the first downstream job triggers another downstream job, we lose the JIRA_ISSUES value. The goal is that we're trying to replicate the functionality that the first downstream job has in detecting all JIRA issues accumulated from multiple upstream builds, and have that do the same when the first downstream job triggers the next downstream job.   Ultimately, have this: Detect the diff of JIRA issues coming into it's environment, no matter where in the chain of downstream jobs it is.

          nick tan added a comment -

          this could be same problem when I saw the value on Parameters page is empty:

          However, I checked the job build.xml, I do see the parameter was persisted:

          <parameters>
          <hudson.plugins.jira.listissuesparameter.JiraIssueParameterValue plugin="jira@2.3.1">
          <name>JIRA_ID</name>
          <value>ABC-123</value>
          </hudson.plugins.jira.listissuesparameter.JiraIssueParameterValue>
          </parameters>
          <parameterDefinitionNames class="hudson.model.ParametersDefinitionProperty$1">
          <outer-class&gt;
          <parameterDefinitions>
          <hudson.plugins.jira.listissuesparameter.JiraIssueParameterDefinition plugin="jira@2.3.1">
          <name>JIRA_ID</name>
          <description>blah blah</description>
          <jiraIssueFilter>my query</jiraIssueFilter>
          </hudson.plugins.jira.listissuesparameter.JiraIssueParameterDefinition>
          </outer-class&gt;
          </parameterDefinitionNames>
          
          

          nick tan added a comment - this could be same problem when I saw the value on Parameters page is empty: However, I checked the job build.xml, I do see the parameter was persisted: <parameters> <hudson.plugins.jira.listissuesparameter.JiraIssueParameterValue plugin= "jira@2.3.1" > <name>JIRA_ID</name> <value>ABC-123</value> </hudson.plugins.jira.listissuesparameter.JiraIssueParameterValue> </parameters> <parameterDefinitionNames class= "hudson.model.ParametersDefinitionProperty$1" > < outer - class& gt; <parameterDefinitions> <hudson.plugins.jira.listissuesparameter.JiraIssueParameterDefinition plugin= "jira@2.3.1" > <name>JIRA_ID</name> <description>blah blah</description> <jiraIssueFilter>my query</jiraIssueFilter> </hudson.plugins.jira.listissuesparameter.JiraIssueParameterDefinition> </ outer - class& gt; </parameterDefinitionNames>

          Tommy Tynjä added a comment -

          missedone is this an issue with the delivery pipeline plugin or related to something else?

          Tommy Tynjä added a comment - missedone is this an issue with the delivery pipeline plugin or related to something else?

            tommysdk Tommy Tynjä
            jlevis Joe Levis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: