Hi,
I need to automatically get all queued build jobs that can be build by a specific agent. What I want is the list you can get in each agents overview page in the "Executable jobs" and "Executable deployment environments" tabs.
But actually it's hard to get this information using the REST API. The Endpoint /agent/assignment provides "nameElements" - a list of project, plan and job names. But The /queue endpoint provides keys of the projects, plans and jobs ("PROJ-PLAN-JOB").
With detours via /plan and /project endpoints I can determine name-key matching. But to find the key for jobs I need to call /search/jobs/{planKey} for each agent assignment on a job.
Isn't there an easier and more resource saving way to get all queued builds for a specific agent?