Jenkins API: retrieve the complete list of jobs in one single rest api access

4,220 views
Skip to first unread message

Victor Martinez

unread,
Nov 1, 2016, 8:19:04 AM11/1/16
to Jenkins Users
Hi there,

 I'd like to know whether there is an easy way of retrieving the entire list of jobs in one single rest api even when those jobs are in folders without iterating through the rest api by doing traversal search or any other tree search.

 I've found the below suggestion, but I'm not a fan of using hardcoded depth values:
      

Thanks
 

Victor Martinez

unread,
Nov 1, 2016, 8:41:38 AM11/1/16
to Jenkins Users
If I run

println Jenkins.instance.getAllItems().collect {it.fullName}

it works as expected since it does some recursive search:

I assume no API support for that yet. Does it make sense to raise a ticket? or is intended to be like that? Besides of that, if you have any example I could reuse to do that search please let me know

Thanks 

Victor Martinez

unread,
Nov 16, 2016, 7:27:26 AM11/16/16
to Jenkins Users
Already raised a Jira ticket:

Cheers
Reply all
Reply to author
Forward
0 new messages