jenkinsci / jenkinsci/lockable-resources-plugin

How to check which job/branch has locked my resource in Groovy?

Open
#148 4 comments 0 reactions 1 assignee Claimed by @mPokornyETM View on GitHub
API interactions skipIfLocked Triage
Dominant language
Java
Stars
99
Forks
205
Avg merge
2d 13h
Merged PRs (30d)
8

Description

Hello there,

I have got a scripted pipeline, and before I enter my lock('xyz'){ ... } block, I want to check which job or branch is currently occuping the lock on my resource 'xyz'.
I know I can see it in the GUI - Lockable Resources on Jenkins Home Page but it would be efficient if we can print the job name right there in the build waiting for the job.

Could someone please advise if there is an option available to query the lockable resource or is this a kind of feature request?

Thanks.
Atif

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.