when I run following code in Jenkins script console then I get the job location but I am wondering if there is a way to get whole url to the job rather then just the path.
Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject).each {it ->
println it.fullName;
}
output is Results: aa/prj1/prj/pr bb/prj1/prj/pr cc/prj2/prj/pr
what I am trying to do is to get https://jenkinsmy.aa.com/job/aa/job/prj1/job/prj2/master
that way I can directly reach the job or config files for all of them
I am not sure about the script console but you can get all the job url from normal groovy script.
pipeline {
agent any
stages {
stage('Test') {
steps {
script {
def jobUrl = Jenkins.instance.getAllItems(AbstractItem.class)
jobUrl.each { iti ->
println "${JENKINS_URL}/job/${iti.fullName}"
}
}
}
}
}
}