title: How to parametrize number of threads in JMeter 5.2.1
body: <p>I have a JMeter 5.2.1 project where in the SetUp thread I generate properties with names like <code>ThreadGroupName1-NumberOfThreads</code>, <code>ThreadGroupName2-NumberOfThreads</code>, etc. with values representing integers.</p>
  
  <p>Now, I wish to access these properties in thread groups named <code>ThreadGroupName1</code>, <code>ThreadGroupName2</code>, etc. to parametrize the number of threads. I tried something like <code>${__jexl3(props.get(threadName + "-NumberOfThreads"))}</code> but it fails as <code>threadName</code> evaluates to <code>standardjmeterengine</code>.</p>
  
  <p>Also, I tried to use <code>ctx</code> but <code>ctx.getThread()</code> and <code>ctx.getThreadGroup()</code> but they evaluate to <code>null</code>.</p>
  
  <p>So far what 'works' for me is <code>${__jexl3(props.get("ThreadGroupName1-NumberOfThreads"))}</code> but I want it be parametrized by the name of the thread group.</p>
  
  <p>Is it possible to do this?</p>
  
  <p>Is this <code>threadName</code> returning <code>standardjmeterengine</code> a bug?</p>
  
  <p>Update: In fact, the easiest 'solution' that provides the parametrized number of threads there is <code>${__P(ThreadGroupName1-NumberOfThreads)}</code> and what I want is to generate this key <code>ThreadGroupName1-NumberOfThreads</code> to be something like <code>${MyCurrentGroupName}-NumberOfThreads</code>, effectively providing a way to have an abstract method like</p>
  
  <pre><code>int GetNumberOfThreads(string threadGroupName)
  {
    return properties.get(threadGroupName + "-NumberOfThreads";
  }
  </code></pre>
  
  <p>Similarly, I wish to use this patter in Constant Throughput Timer as well with another prefix like <code>-Rpm</code>.</p>