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

CLI list-jobs is not listing multibranch sub projects

      The CLI list-jobs is not listing sub projects of an multibranch project.

          [JENKINS-35148] CLI list-jobs is not listing multibranch sub projects

          Daniel Beck added a comment -

          What job type are you specifically referring to?

          Daniel Beck added a comment - What job type are you specifically referring to?

          Martin Heinzerling added a comment - - edited

          danielbeck, the jobs of a Multibranch Pipeline. If I ask for all jobs I get the folder of the Multibranch Pipeline, but not it's content.

          Martin Heinzerling added a comment - - edited danielbeck , the jobs of a Multibranch Pipeline. If I ask for all jobs I get the folder of the Multibranch Pipeline, but not it's content.

          Daniel Beck added a comment -

          It's not recursive. Are you saying list-jobs NameOfTheMultibranchFolder does not work?

          Daniel Beck added a comment - It's not recursive. Are you saying list-jobs NameOfTheMultibranchFolder does not work?

          Daniel Beck added a comment -

          No response to comment asking for clarification in a year.

          Daniel Beck added a comment - No response to comment asking for clarification in a year.

          Sven Kirmess added a comment -

          danielbeck This is correct, you're unable to get the configured multibranch workflow branches

          $ java -jar ~/jenkins-cli/jenkins-cli.jar -auth @~/jenkins-cli/auth.txt -s "http://localhost:8080/" -webSocket list-jobs | grep SSL_daily
          SSL_daily
          $ java -jar ~/jenkins-cli/jenkins-cli.jar -auth @~/jenkins-cli/auth.txt -s "http://localhost:8080/" -webSocket list-jobs SSL_daily
          
          ERROR: No view or item group with the given name 'SSL_daily' found.
          

          Sven Kirmess added a comment - danielbeck This is correct, you're unable to get the configured multibranch workflow branches $ java -jar ~/jenkins-cli/jenkins-cli.jar -auth @~/jenkins-cli/auth.txt -s "http://localhost:8080/" -webSocket list-jobs | grep SSL_daily SSL_daily $ java -jar ~/jenkins-cli/jenkins-cli.jar -auth @~/jenkins-cli/auth.txt -s "http://localhost:8080/" -webSocket list-jobs SSL_daily ERROR: No view or item group with the given name 'SSL_daily' found.

          Daniel Beck added a comment -

          gdj Could you provide the "full name" of a branch job in your environment so the output makes sense to users not knowing it?

          Daniel Beck added a comment - gdj Could you provide the "full name" of a branch job in your environment so the output makes sense to users not knowing it?

          Sven Kirmess added a comment -

          SSL_daily is the multibranch workflow project, which configures the branches from git. The URL for the full job looks like so: http://example.com:8090/job/SSL_daily/job/master/

          If you try to build just SSL_daily it'll fail.

          $ java -jar ~/jenkins-cli/jenkins-cli.jar -auth @~/jenkins-cli/auth.txt -s "http://localhost:8080/" -webSocket build SSL_daily
          
          ERROR: No such job 'SSL_daily'; perhaps you meant 'SSL_daily/master'?
          

          You also have to specify the branch for build to work.

          $ java -jar ~/jenkins-cli/jenkins-cli.jar -auth @~/jenkins-cli/auth.txt -s "http://localhost:8080/" -webSocket ~proci/bin/jenkins-cli build SSL_daily/master
          $ echo $?
          0
          

          Sven Kirmess added a comment - SSL_daily is the multibranch workflow project, which configures the branches from git. The URL for the full job looks like so: http://example.com:8090/job/SSL_daily/job/master/ If you try to build just SSL_daily it'll fail. $ java -jar ~/jenkins-cli/jenkins-cli.jar -auth @~/jenkins-cli/auth.txt -s "http://localhost:8080/" -webSocket build SSL_daily ERROR: No such job 'SSL_daily'; perhaps you meant 'SSL_daily/master'? You also have to specify the branch for build to work. $ java -jar ~/jenkins-cli/jenkins-cli.jar -auth @~/jenkins-cli/auth.txt -s "http://localhost:8080/" -webSocket ~proci/bin/jenkins-cli build SSL_daily/master $ echo $? 0

          Daniel Beck added a comment -

          Interesting. I see where this is coming from, ComputedFolder isn't a ModifiableTopLevelItemGroup and that is what ListJobsCommand expects. There's no TopLevelItemGroup or similar more applicable interface, unfortunately.

          Daniel Beck added a comment - Interesting. I see where this is coming from,  ComputedFolder isn't a ModifiableTopLevelItemGroup and that is what  ListJobsCommand expects. There's no TopLevelItemGroup or similar more applicable interface, unfortunately.

          Sven Kirmess added a comment -

          Does that mean that can't easily be fixed?

          The branches are available from the script console.

          hudson.model.Hudson.instance.getItemByFullName('SSL_daily').getAllJobs()
          
          Result: [org.jenkinsci.plugins.workflow.job.WorkflowJob@56d136ee[SSL_daily/master]]
          

          Sven Kirmess added a comment - Does that mean that can't easily be fixed? The branches are available from the script console. hudson.model.Hudson.instance.getItemByFullName('SSL_daily').getAllJobs() Result: [org.jenkinsci.plugins.workflow.job.WorkflowJob@56d136ee[SSL_daily/master]]

            Unassigned Unassigned
            mheinzerling Martin Heinzerling
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: