In the BeanShell statement description section, you can find the following:
vars - JMeterVariables - eg vars.get("VAR1"); vars.put("VAR2","value"); vars.putObject("OBJ1",new Object()); props - JMeterProperties (class java.util.Properties) - eg props.get("START.HMS"); props.put("PROP1","1234");
So, to set the jmeter variable in beanshell code (the BeanShell Assertion probe in your case), use the following:
String docid = "abcd"; vars.put("docid",docid);
or simply
vars.put("docid","abcd");
and then you can forward it as $ {docid}, as you did in your HTTP request.
Aliaksandr Belik
source share