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

Active Choice reactive parameter dosen't work on first selection of reference parameter

    Details

    • Similar Issues:

      Description

      Am populating the APP_NAME as a choice parameter and adding that as a reference parameter to an "Active choice reference parameter". Based on the selection of the "APP_NAME", the tags for that app should populate. But when i select APP_NAME as "A", it dosen't populate the tags on the first selection, instead it populated the A's tags one step later (ie) when i do the second selection.

      Below is the groovy script :

      import groovy.json.JsonSlurper

      if (APP_NAME.equals(queries)){
      "curl -s -k -u devuser:devuser -o /data/jenkins/properties/docker-tag-result.json https://XXXX/api/v0/repositories/dcf/queries/tags".execute()

      def jsonSlurper = new JsonSlurper()
      def reader = new BufferedReader(new InputStreamReader(new FileInputStream("/data/jenkins/properties/docker-tag-result.json"),"UTF-8"));
      data = jsonSlurper.parse(reader);
      return data.tags.name.each{println it}
      }

      else if (APP_NAME.equals(controlsprocessor)){
      "curl -s -k -u devuser:devuser -o /data/jenkins/properties/docker-tag-result.json https://xxxx/dcf/controlsprocessor/tags".execute()

      def jsonSlurper = new JsonSlurper()
      def reader = new BufferedReader(new InputStreamReader(new FileInputStream("/data/jenkins/properties/docker-tag-result.json"),"UTF-8"));
      data = jsonSlurper.parse(reader);
      return data.tags.name.each{println it}
      }else if (APP_NAME.equals(properties)){
      "curl -s -k -u devuser:devuser -o /data/jenkins/properties/docker-tag-result.json https://xxxx/dcf/properties/tags".execute()

      def jsonSlurper = new JsonSlurper()
      def reader = new BufferedReader(new InputStreamReader(new FileInputStream("/data/jenkins/properties/docker-tag-result.json"),"UTF-8"));
      data = jsonSlurper.parse(reader);
      return data.tags.name.each{println it}
      }else{
      return["Unknown APP Name"]}

        Attachments

          Activity

          Hide
          ioannis Ioannis Moutsatsos added a comment -

          Please, make sure you are using the most recent update of the plugin. That is Active Choices v2.1

          If not, can you please upgrade to this version and report results back here. Thank you!

          Show
          ioannis Ioannis Moutsatsos added a comment - Please, make sure you are using the most recent update of the plugin. That is Active Choices v2.1 If not, can you please upgrade to this version and report results back here. Thank you!
          Hide
          srava Sravanthi Chadalavada added a comment -

          Please ignore, i fixed it

          Show
          srava Sravanthi Chadalavada added a comment - Please ignore, i fixed it

            People

            • Assignee:
              kinow Bruno P. Kinoshita
              Reporter:
              evangeline_ibm Evan Joseph
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: