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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • active-choices-plugin
    • None
    • Production

      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"]}

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

              Created:
              Updated:
              Resolved: