add_if_controller
Add an If Controller to a test plan so child samplers run only when a JavaScript condition evaluates true after variable substitution.
Instructions
Add an If Controller under the given parent (usually a Thread Group). Samplers added under it (as its children) only run when the condition evaluates truthy. condition is evaluated as a real JavaScript (Rhino) expression after JMeter substitutes any ${var} references, so comparisons work directly, e.g. '${count} < 10' or '"${status}" == "ok"'.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"planId": "<planId>",
"parentId": "<parentId>",
"condition": "<condition>"
},
"name": "add_if_controller"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | If Controller | |
| planId | Yes | ||
| parentId | Yes | ||
| condition | Yes | JavaScript boolean expression evaluated after ${var} substitution, e.g. '${count} < 10' | |
| evaluateAll | No | Evaluate the condition for every iteration, not just the first |