0
votes

The below job dsl creates a new job, list view, and should add the new job to the view, but its 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

1

1 Answers

0
votes

I feel dumb now, but this behavior is a little odd. Looks like you need to add columns to the view or you wont 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()
    }
}