Unblock jobid generation

I have a couple of steps that setup a custom hook that will unblock a select block step that comes later in the pipeline via the API.
What would be the right way of passing the jobid there? it does not seem like we can unblock a block step by key or name, we’d need the jobid but it seems to be randomly generated.

Hi @arkaitzj welcome to the forum :wave:

You will need the build number and job ID in order to unblock it from the API: Jobs API | Buildkite Documentation.

Any step in the build will have the build number environment variable available, but the job ID will only be available in the API. So you’ll have to query the build and search through the jobs object to find the job you want to unblock: Builds API | Buildkite Documentation.

The jobs field is an array of all the jobs in the build. You can search through those entries for the step key and retrieve the ID that way.

Hope that helps