title: Get a list of currently running jenkins builds with their parameters
body: <p>I'm writing a pipeline job using groovy. I need to get the info about running builds of the same job, with the build's parameters and their ids, so I can later filter it by parameters</p>
  <p>I found these questions how to achieve that</p>
  <p><a href="https://stackoverflow.com/questions/14843874/from-jenkins-how-do-i-get-a-list-of-the-currently-running-jobs-in-json">From Jenkins, how do I get a list of the currently running jobs in JSON?</a></p>
  <p><a href="https://stackoverflow.com/questions/44988884/how-do-i-efficiently-list-all-currently-running-jobs-on-jenkins-using-groovy">How do I Efficiently list **All** currently running jobs on Jenkins using Groovy</a></p>
  <p>and the proposed solution do return the information about the jobs, but they return too many results (not only active jobs) and have other problems</p>
  <p>For example <code>http://jenkins.example.com/api/xml?tree=jobs[name,url,color]&amp;xpath=/hudson/job[ends-with(color/text(),%22_anime%22)]&amp;wrapper=jobs</code> doesn't return any info about builds</p>
  <p>The closest guess so far was <code>https://jenkins.example.com/api/xml?tree=jobs[name,status,id,result,builds[number,actions[parameters[name,value]]]]&amp;xpath=/hudson/job[name=&quot;job_name&quot;]&amp;wrapper=job_names&amp;pretty=true</code> but it returns lost of just <code>action</code> items and doesn't indicate which builds are active</p>
  <p>Any help to achieve what I want is appreciated. The preferred output is JSON</p>