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

Jelly forms control: server-side methods (e.g. doFillXyzItems) are not invoked based on @QueryParameter credentialId when credentials are selected from drop down list in case if credential field property expressionAllowed is set to true in jelly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • credentials-plugin
    • None

      Within CloudBees Flow plugin we are going to use Credentials plugin for overriding credentials within some post-build actions. We want both "Specific credentials" (select field) and "Parameter expression" (input text field) options to be provided (credential field property expressionAllowed to be set to true in jelly).

      On Freestyle UI of the post-build actions there are dependent fields and we expect that on selecting credentialId from drop down list some doFillXyzItems() and doCheckXYZ() will be triggered.

      Issue:

      Triggering of the mentioned methods works only if "Parameter expression" is changed and it does not work when "Specific credentials" are selected (in case when expressionAllowed is set to "true")

      Workaround:

      It works for "Specific credentials" if "expressionAllowed is set to "false" (but in this case there will be not "Parameter expression" option)

       

      Some notes:

      1.

      the above seems to not working e.g. for doFillXyzItems(@QueryParameter String credentialId, ...) due to <select> (Specific credential) and <input> (Parameter expression) fields have similar name "credentialId" within generate html:

       

      //select[@name='_.credentialId']
      //input[@name='_.credentialId']

      2.

      In general, if there are two fields with the same name doFillXyzItems will be triggered only if second field is changed.

      Such situation is within Credentials field (when expressions are allowed). There are two fields with the same name (field="${attrs.field}"):
      https://github.com/jenkinsci/credentials-plugin/blob/master/src/main/resources/lib/credentials/select.jelly#L106
      https://github.com/jenkinsci/credentials-plugin/blob/master/src/main/resources/lib/credentials/select.jelly#L157

       

            Unassigned Unassigned
            ovasilko Oleksii Vasylkivskyi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: