[JIRA] (JENKINS-40631) first build fails because of missing parameter

1 view
Skip to first unread message

domi@fortysix.ch (JIRA)

unread,
Dec 22, 2016, 7:45:01 AM12/22/16
to jenkinsc...@googlegroups.com
Dominik Bartholdi created an issue
 
Jenkins / Bug JENKINS-40631
first build fails because of missing parameter
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2016/Dec/22 12:44 PM
Priority: Critical Critical
Reporter: Dominik Bartholdi

when

The first automatic job execution of a job created by a "multibranch project" will be triggered without parameters. e.g. the following pipeline will print "null" instead of the default value of MY_PARAM. Subsequent executions will work correctly. This is very unfortunate, as such jobs are typically created for short lived branches, in the most ideal case, no further commits are even made to them - they get merged and vanish again.

pipeline {

  parameters {
    choiceParam(choices: 'AA\nBB', description: 'please select...', name: 'MY_PARAM')
  }  

  agent any
  stages {

    stage ('test') {
      steps {
          sh "echo ${env.MY_PARAM}"
      }
    }
  }
}
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

domi@fortysix.ch (JIRA)

unread,
Dec 22, 2016, 7:46:02 AM12/22/16
to jenkinsc...@googlegroups.com
Dominik Bartholdi updated an issue
Change By: Dominik Bartholdi
when


The first automatic job execution of a job created by a "multibranch project" will be triggered without parameters. e.g. the following pipeline will print "null" instead of the default value of MY_PARAM. Subsequent executions will work correctly. This is very unfortunate, as such jobs are typically created for short lived branches, in the most ideal case, no further commits are even made to them - they get merged and vanish again.

{noformat}

pipeline {

  parameters {
    choiceParam(choices: 'AA\nBB', description: 'please select...', name: 'MY_PARAM')
  }  

  agent any
  stages {

    stage ('test') {
      steps {
          sh "echo ${env.MY_PARAM}"
      }
    }
  }
}
{noformat}

andrew.bayer@gmail.com (JIRA)

unread,
Dec 22, 2016, 8:19:01 AM12/22/16
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-40631
 
Re: first build fails because of missing parameter

Try params.PARAM - I think that'll work.

domi@fortysix.ch (JIRA)

unread,
Dec 22, 2016, 8:26:01 AM12/22/16
to jenkinsc...@googlegroups.com
Dominik Bartholdi resolved as Fixed
 

many thanks, that works!! I try to take some time to enhance the documentation...

Change By: Dominik Bartholdi
Status: Open Resolved
Resolution: Fixed

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:37 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages