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

submitterParameter does not work without at least one actual parameter

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hello,

      According to the documentation I should be able to do the following:

      def ret = input(message: 'some message', submitterParameter: 'username_approval')
      println(ret['username_approval'])

      However I only receive a null object instead of the expected map.

      Regards,

        Attachments

          Issue Links

            Activity

            Hide
            slillibri Scott Lillibridge added a comment -

            To add more information, I am seeing this same issue. I am only able to access submitterParameter if I also include parameters. Using the workflow defined in the test test_submitter_parameter_no_submitter() I see the following behavior:

            Pipeline:

            def x = input message:'Do you want chocolate?', id:'Icecream', ok: 'Purchase icecream', submitterParameter: 'approval'
            echo("after: ${x}")
            def y = input message:'Do you want chocolate?', id:'Icecream', ok: 'Purchase icecream', submitterParameter: 'approval', parameters: [string(defaultValue: 'herp', description: '', name: 'derp')]
            echo("after: " + y['approval'])
            

            Output:

            Started by user Scott Lillibridge
            [Pipeline] input
            Do you want chocolate?
            Purchase icecream or Abort
            Approved by Scott Lillibridge
            [Pipeline] echo
            after: null
            [Pipeline] input
            Input requested
            Approved by Scott Lillibridge
            [Pipeline] echo
            after: scott.lillibridge
            [Pipeline] End of Pipeline
            Finished: SUCCESS

            Is there a different way to access the submitterParameter without including parameters?

            Versions/Environment:

            Jenkins 2.36 (rpm installed from the jenkins-ci repository)
            Pipeline Input Step 2.5
            openjdk version "1.8.0_111"
            OpenJDK Runtime Environment (build 1.8.0_111-b15)
            OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)

            Show
            slillibri Scott Lillibridge added a comment - To add more information, I am seeing this same issue. I am only able to access submitterParameter if I also include parameters. Using the workflow defined in the test test_submitter_parameter_no_submitter() I see the following behavior: Pipeline: def x = input message: 'Do you want chocolate?' , id: 'Icecream' , ok: 'Purchase icecream' , submitterParameter: 'approval' echo( "after: ${x}" ) def y = input message: 'Do you want chocolate?' , id: 'Icecream' , ok: 'Purchase icecream' , submitterParameter: 'approval' , parameters: [string(defaultValue: 'herp' , description: '', name: ' derp')] echo( "after: " + y[ 'approval' ]) Output: Started by user Scott Lillibridge [Pipeline] input Do you want chocolate? Purchase icecream or Abort Approved by Scott Lillibridge [Pipeline] echo after: null [Pipeline] input Input requested Approved by Scott Lillibridge [Pipeline] echo after: scott.lillibridge [Pipeline] End of Pipeline Finished: SUCCESS Is there a different way to access the submitterParameter without including parameters? Versions/Environment: Jenkins 2.36 (rpm installed from the jenkins-ci repository) Pipeline Input Step 2.5 openjdk version "1.8.0_111" OpenJDK Runtime Environment (build 1.8.0_111-b15) OpenJDK 64-Bit Server VM (build 25.111-b15, mixed mode)
            Hide
            kaulk Kuber Kaul added a comment -

            Facing the same issue - Jenkins version - 2.44 , Pipeline Input Step 2.5 .

            Show
            kaulk Kuber Kaul added a comment - Facing the same issue - Jenkins version - 2.44 , Pipeline Input Step 2.5 .
            Hide
            kaulk Kuber Kaul added a comment -

            It seems necessary to include at least one custom parameter. For example this will work:

            def inputResponse = input(message: 'Should we proceed', submitter: "myorg*myteam", submitterParameter: 'approver', parameters:[booleanParam(defaultValue: false, description: '', name: 'promote')] )
            

            But the more sensible simplification returns null:

            def inputResponse = input(message: 'Should we proceed', submitter: "myorg*myteam", submitterParameter: 'approver' )
            
            Show
            kaulk Kuber Kaul added a comment - It seems necessary to include at least one custom parameter. For example this will work: def inputResponse = input(message: 'Should we proceed' , submitter: "myorg*myteam" , submitterParameter: 'approver' , parameters:[booleanParam(defaultValue: false , description: '', name: ' promote')] ) But the more sensible simplification returns null: def inputResponse = input(message: 'Should we proceed' , submitter: "myorg*myteam" , submitterParameter: 'approver' )
            Hide
            jhovell John Hovell added a comment - - edited

            Sorry just commented on incorrect ticket. Confirmed this behavior is what I see as well in 2.5 of input step plugin.

            Show
            jhovell John Hovell added a comment - - edited Sorry just commented on incorrect ticket. Confirmed this behavior is what I see as well in 2.5 of input step plugin.
            Hide
            jglick Jesse Glick added a comment -

            PR 13 may be fixing this.

            Show
            jglick Jesse Glick added a comment - PR 13 may be fixing this.
            Hide
            tangkun75 Kun Tang added a comment -

            I've updated the changes for this issue. Please review it.

            Show
            tangkun75 Kun Tang added a comment - I've updated the changes for this issue. Please review it.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kun Tang
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution.java
            http://jenkins-ci.org/commit/pipeline-input-step-plugin/db8641f197b171e5ca94190ceb43e43f3103ea83
            Log:
            JENKINS-40594
            submitterParameter does not work without at least one actual parameter

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kun Tang Path: src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution.java http://jenkins-ci.org/commit/pipeline-input-step-plugin/db8641f197b171e5ca94190ceb43e43f3103ea83 Log: JENKINS-40594 submitterParameter does not work without at least one actual parameter
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kun Tang
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution.java
            src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java
            http://jenkins-ci.org/commit/pipeline-input-step-plugin/c31b370008145e91e8900db7264d3c6087f79ef7
            Log:
            Update a test and add @Issue annotation for JENKINS-40594

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kun Tang Path: src/main/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepExecution.java src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java http://jenkins-ci.org/commit/pipeline-input-step-plugin/c31b370008145e91e8900db7264d3c6087f79ef7 Log: Update a test and add @Issue annotation for JENKINS-40594

              People

              • Assignee:
                tangkun75 Kun Tang
                Reporter:
                acecile Adam Cecile
              • Votes:
                5 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: