The REGEX_GROUP_MATCH function is used to match a regular expression pattern against a string content and retrieve a specific declared group.

Usable: Value Fields, Context Filter

Syntax: { REGEX_GROUP_MATCH((PARAM_1 PARAM_2 PARAM_3)) }

Parameter

Type

Examples

Description

PARAM_1

JSONPath value

$.issue.fields.customfield_X
$.value

The JSONPath expression representing the value that should be matched against the regular expression pattern.

PARAM_2

String

'\((\S*)\)'

The regular expression pattern to match against the value in PARAM_1

PARAM_3

String

'1'
'2'

The matching group that should be used

Value Field Example

Get the value of the second group match

{ REGEX_GROUP_MATCH(($.value '^([^\s]*)' '2')) }
CODE

If $.value contains 'the name (7) (test)' the result will be test.

Context Filter Example

To filter results where the “id” equals the custom field value of the issue at the first quotes:

{ REGEX_GROUP_MATCH(($.issue.fields.customfield_X '\((\S*)\)' '1')) }
CODE

If the $.issue.fields.customfield__X field contains 'the name (7) (test)' the expression will resolve to:

$.result[?(@.id=='7')]
CODE