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

Approvers field doesn't expand variable in the build

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • promoted-builds-plugin
    • None
    • Ubuntu 16.04
      Jenkins ver. 2.46.2 LTS
      promoted builds plugin v2.28.1

      Under "Criteria" section,
      when select "Only when manually approved",
      Approvers field doesn't expand variable in the build.

        1. Selection_020.png
          Selection_020.png
          44 kB
        2. Selection_021.png
          Selection_021.png
          22 kB
        3. Selection_022.png
          Selection_022.png
          45 kB

          [JENKINS-49486] Approvers field doesn't expand variable in the build

          Rick Liu created issue -
          Rick Liu made changes -
          Attachment New: Selection_020.png [ 41420 ]
          Attachment New: Selection_021.png [ 41421 ]
          Attachment New: Selection_022.png [ 41422 ]
          Oleg Nenashev made changes -
          Issue Type Original: Bug [ 1 ] New: New Feature [ 2 ]
          Oleg Nenashev made changes -
          Assignee Original: Oleg Nenashev [ oleg_nenashev ]

          Oleg Nenashev added a comment -

          IMHO it is rather a new feature request, not a defect. Reason: support of properties in this field is not documented anywhere AFAICT. Please correct me if I am wrong

          Oleg Nenashev added a comment - IMHO it is rather a new feature request, not a defect. Reason: support of properties in this field is not documented anywhere AFAICT. Please correct me if I am wrong
          Rick Liu made changes -
          Comment [ [~oleg_nenashev]
          Hi Oleg,
          If I want to develop this feature,
          what approach would you recommand?

          1.
          Try to bring in Token Macro plugin's
          {{TokenMacro.expandAll(build, listener, approval.name)}}
          in File "*conditions/ManualCondition.java*" [Line118|https://github.com/jenkinsci/promoted-builds-plugin/blob/master/src/main/java/hudson/plugins/promoted_builds/conditions/ManualCondition.java#L118], [Line140|https://github.com/jenkinsci/promoted-builds-plugin/blob/master/src/main/java/hudson/plugins/promoted_builds/conditions/ManualCondition.java#L140]

          2.
          Or try something similar in File "*conditions/ParameterizedSelfPromotionCondition.java*"
          [Line49|https://github.com/jenkinsci/promoted-builds-plugin/blob/master/src/main/java/hudson/plugins/promoted_builds/conditions/ParameterizedSelfPromotionCondition.java#L49] to use {{build.getBuildVariables()}} to cross-reference the variable ]
          Rick Liu made changes -
          Comment [ [~samsun387]
          test ]

          Rick Liu added a comment -

          Rick Liu added a comment - Pull-request prepared: https://github.com/jenkinsci/promoted-builds-plugin/pull/114

            Unassigned Unassigned
            totoroliu Rick Liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: