0

The below job DSL creates a new job, list view, and should add the new job to the view, but it's not adding the job to the view- the job runs without any errors though:

multibranchPipelineJob("myjob") {
  branchSources {
    branchSource {
      source {
        bitbucket {
          credentialsId('bitbucket-login-user-pass')
          repoOwner('myteam')
          repository('myrepo')
          autoRegisterHook(true)
        }
      }
    }
  }
}
//listview is created, but job not added to it
listView('mylistview') {
  jobs {
    name('myjob')
  }
}

I suspect I'm doing something dumb. Everything is created but when I click on the tab for the "mylistview", "myjob" is not there.

halfer
  • 19,824
  • 17
  • 99
  • 186
red888
  • 27,709
  • 55
  • 204
  • 392

1 Answers1

0

I feel dumb now, but this behavior is a little odd. Looks like you need to add columns to the view or you won't see anything!

How to put jobs inside a folder in jenkins?

listView('MyJobsList') {
  jobs {
     map.each{
       name((it.key).trim())
     }
  }
   columns{
        status()
        weather()
        name()
        lastSuccess()
        lastFailure()
        lastDuration()
        buildButton()
    }
}
halfer
  • 19,824
  • 17
  • 99
  • 186
red888
  • 27,709
  • 55
  • 204
  • 392