matches()

This function returns true, if the given text matches a regular expression, otherwise it returns false.

Bash
matches(text, regex) #Output: Boolean

Examples

Parser expression

Description

Bash
%{matches(%{issue.attachments}, ".*.txt$") ? "Text file found." : "No text file found."}

If the current issue has at least one .txt file attached, using the conditional operator, this example returns:

Text file found


Bash
%{matches("Jira Workflow Toolbox", "[JWT].+") ? "true" : "false"}

Using the conditional operator, this example returns:

true

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

text

text

Any given text.

regex

text

A valid regular expression that the given text will be checked against.

Output

This function returns a boolean


(books) Use cases and examples