title: How to get the name of locked resource in Jenkins Lockable Resource plugin
body: <p>I am using Jenkins Lockable Resources plugin to decide which server to be used for various build operations in my declarative pipeline. I have set up my Lockable Resources as shown in the table below:</p>
  
  <pre><code>Resource Name       Labels
  
  Win_Res_1           Windows
  Win_Res_2           Windows
  Win_Res_3           Windows
  Lx_Res_1            Linux
  Lx_Res_2            Linux
  Lx_Res_3            Linux
  </code></pre>
  
  <p>I want to lock a <code>label</code> and then get the name of the corresponding locked <code>resource</code>.</p>
  
  <p>I'm writing following code but am not able to get the desired value of <code>r</code></p>
  
  <pre><code>int num_resources = 1;
  def label = "Windows"; /* I have hardcoded it here for simplicity. In actual code, I will get ${lable} from my code and its value can be either Windows or Linux. */
  
  lock(label: "${label}", quantity: num_resources)
  {
      def r = org.jenkins.plugins.lockableresources.LockableResourcesManager; /* I know this is incomplete but unable to get correct function call */
      println (" Locked resource r is : ${r} \n");
  
      /* r should be name of resource for example Win_Res_1. */
  }
  </code></pre>
  
  <p>The documentation for <code>Lockable Resources Plugin</code> is available here: <a href="https://jenkins.io/doc/pipeline/steps/lockable-resources/" rel="nofollow noreferrer">https://jenkins.io/doc/pipeline/steps/lockable-resources/</a>
  and 
  <a href="https://plugins.jenkins.io/lockable-resources/" rel="nofollow noreferrer">https://plugins.jenkins.io/lockable-resources/</a></p>