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?
Hello @Michael
You will have to use SQL to retrieve what you want. Please check the following KB article for some sample queries. You may have to adapt them to your requirements.
Sincerely,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.