JOIN
The JOIN function is used to concatenate multiple strings with a specified delimiter in between for a given JSONPath array.
Usable: Value Fields, Context Filter
Syntax: { JOIN((PARAM_1 PARAM_2)) }
Parameter | Type | Examples | Description |
---|---|---|---|
PARAM_1 | JSONPath array |
| The JSONPath expression representing the array that should be concatenated. |
PARAM_2 | String |
| Character used as delimiter |
Value Field Example
For example, consider the following data source JSON:
{
"result": [
{
"name": "Mario",
},
{
"name": "Luigi",
}
]
}
Use the JOIN function to concatenate the JSONPath names with the &
symbol
{ JOIN(($.result[*].name '&')) }
This will result in Mario & Luigi
Context Filter Example
Use the JOIN
function to build part of a regular expression by concatenating the values with the pipe symbol
$.result[?(@.name=~/({ JOIN(( $.issue.fields.customfield_10XXX[*].value '|' )) })/g )]
If $.issue.fields.customfield__X
contains a list of Mario
and Luigi
the expression will result in:
$.result[?(@.name=~/(Mario|Luigi)/g )]