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--
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.