Skip to main content
Skip table of contents

REGEX_GROUP_MATCH

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

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

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:

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

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

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

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.