robotsnoindex
robotsnoindex

The following smart values are available to access and format text strings when setting up a rule.

The examples below use the summary field value of Hello World!.

abbreviate(int maxLength)

Abbreviates the text string to the defined number of characters and adds "..." to the end. The maxLength parameter needs to be at least 4.

{{issue.summary.abbreviate(8)}} -> Hello Wo...
{{issue.summary.abbreviate(4)}} -> Hell...

For more information, see: StringUtils.abbreviate(int).

chartAt(int index)

Identifies the character at the specified position in the text string.

{{issue.summary.charAt(2)}} -> e
{{issue.summary.charAt(12)}} -> !
{{issue.summary.charAt(7)}} -> W

For more information, see: String.charAt(int).

capitalize()

Capitalizes the first character.

{{issue.summary.capitalize()}} -> Hello world!

For more information, see: StringUtils.capitalize(String).

concat(String str)

Adds a specified text string to the end of the returned value.

{{issue.summary.concat(" It's a beautiful day!")}} -> Hello World! It's a beautiful day!

For more information, see: String.concat(String).

endsWith(String str)

Checks if the text string ends with the specified text, and returns true or false.

{{issue.summary.endsWith("World!")}} -> true
{{issue.summary.endsWith("World@")}} -> false

For more information, see: String.endsWith(String).

htmlEncode()

Encodes text to allow it to be included in HTML content.

{{issue.summary.htmlEncode}} -> Hello world!

indexOf(String str)

Returns the position of the first character in the specified text string.

{{issue.summary.indexOf("Wo")}} -> 6
{{issue.summary.indexOf("ello")}} -> 2
{{issue.summary.indexOf("d!")}} -> 11

For more information, see: String.indexOf(String).

isAlpha()

Checks if the text contains only letters, and returns true or false.

{{issue.summary.isAlpha()}} -> true

For more information, see: StringUtils.isAlpha().

isAlphanumeric()

Checks if the text contains only letters or numbers, and returns true or false.

{{issue.summary.isAlphanumeric()}} -> true

For more information, see: StringUtils.isAlphanumeric().

isEmpty()

Checks to see if the text is empty, and returns true or false.

{{issue.summary.isEmpty()}} -> false

For more information, see: StringUtils.isEmpty().

isNotEmpty()

Checks to see if the text is not empty, and returns true or false.

{{issue.summary.isNotEmpty()}} -> true

For more information, see: StringUtils.isNotEmpty().

isNumeric()

Checks if the text contains only numbers, and returns true or false.

{{issue.summary.isNumeric()}} -> false

For more information, see: StringUtils.isNumeric().

jsonEncode()

Encodes text to allow it to be included in JSON calls, for example, the send outgoing web request action. 

{{issue.summary.jsonEncode}} -> Hello World!

View Json encoding below for details on encoding when sending outgoing webhooks as JSON.

lastIndexOf(String str)

Returns the position of the last character in the specified text string.

{{issue.summary.lastIndexOf("wo")}} -> 7
{{issue.summary.lastIndexOf("ll")}} -> 4
{{issue.summary.lastIndexOf("rl")}} -> 9

For more information, see: string.lastIndexOf(String).

left(int length)

Returns the characters, from the specified amount of characters, from the left of the text string.

{{issue.summary.left(5)}} -> Hello
{{issue.summary.left(9)}} -> Hello Wor
{{issue.summary.left(2)}} -> He

For more information, see: StringUtils.left(int).

leftPad(int length, String pad)

Adds characters to the beginning of the text until the specified total number of characters is reached.

{{issue.summary.leftPad(14, "-")}} -> --Hello World!
{{issue.summary.leftPad(20, "|")}} -> ||||||||Hello World!

For more information, see: StringUtils.leftPad(int, String).

length()

Returns the number of characters in the text string.

{{issue.summary.length()}} -> 12

For more information, see: String.length().

match()

Performs a regular expression search and returns the first (and only one) matching regular expression group.

The underlying implementation is based on Java's Pattern class and uses Matcher.find() to find matches. If multiple matches are found, they return as a collection that can be iterated. This can be used to find a single pattern match (e.g. extract a version number from the issue description) or to match multiple patterns (e.g. extract all e-mail addresses from an issue comment).

{{issue.summary.match(".*(lo).*")}} -> lo {{issue.summary.match(".*(o).*")}} -> [o, o]

quote()

Escapes the smart value into a literal text expression that can be used in a regular expression match using Pattern.quote().

{{issue.summary.quote()}} -> \QHello(.*)World!\E<

remove(String remove)

Removes characters from text.

{{issue.summary.remove("l")}} -> Heo Word!

For more information, see: StringUtils.remove(String).

replace(String target, String replacement)

Replaces all literal text matches with a specified replacement.

{{issue.summary.replace("Hello","Goodbye")}} -> Goodbye World!

For more information, see: String.replace(String, String).

replaceAll(String regex, String replacement)

Performs a regular expression search and replaces any match with the replacement. $1 can be used to access a matching group in the replacement.

{{issue.summary.replaceAll("(lo)","xx$1yy")}} -> Helxxloyy World!

For more information, see: String.replaceAll(String, String).

reverse()

Reverses the characters in the text string.

{issue.summary.reverse()}} -> !dlroW elloH

For more information, see: StringUtils.reverse().

right(int length)

Returns the characters, from the specified amount of characters, from the right of the text string.

{{issue.summary.right(6)}} -> World!

For more information, see: StringUtils.right(int).

rightPad(int length, String pad)

Adds characters to the end of the text string until the specified total number of characters is reached.

{{issue.summary.<br/>rightPadPad(14,"-")}} -> Hello World!--

For more information, see: StringUtils.rightPad(int, String).

split(String separator)

Splits the text and returns the word specified by the word's position in the text string.

{{issue.summary.split(" ").first}} -> Hello

For more information, see: String.split(String).

startsWith(String str)

Checks if the text string starts with the specified text, and returns true or false.

{{issue.summary.startsWith("World!")}} -> false

For more information, see: String.startsWith(String).

substring(int start)

Returns the characters after the amount of characters specified.

{{issue.summary.substring(7)}} -> orld!

For more information, see: StringUtils.substring(int).

substring(int start, int end)

Returns the characters at the positions specified.

{{issue.summary.substring(1,3)}} -> el

For more information, see: StringUtils.substring(int, int).

substringAfter( String separator)

Returns the text after the first occurrence of the given separator.

{{issue.summary.substringAfter("W")}} -> orld!

For more information, see: StringUtils.substringAfter(String).

substringAfterLast(String separator)

Returns the text after the last occurrence of the given separator.

{{issue.summary.substringAfterLast("o")}} -> rld!

For more information, see: StringUtils. substringAfterLast(String).

substringBefore(String separator)

Returns the text before the first occurrence of the given separator.

{{issue.summary.substringBefore("W")}} -> Hello

For more information, see: StringUtils. substringBefore(String).

substringBeforeLast(String separator)

Returns the text before the last occurrence of the given separator.

{{issue.summary.substringBeforeLast("o")}} -> Hello W

For more information, see: StringUtils. substringBeforeLast(String).

substringBetween(String open, String close)

Returns the text between the given parameters.

{{issue.summary.substringBetween("e","d")}} -> llo Worl

For more information, see: StringUtils. substringBetween(String, String).

toLowerCase()

Converts the text string to lower case.

{{issue.summary.toLowerCase()}} -> hello world!

For more information, see: String.toLowerCase().

toUpperCase()

Converts the text string to upper case

{{issue.summary.toUpperCase(}}}} -> HELLO WORLD!


For more information, see: String.toUpperCase().

trim()

Removes any whitespace at the beginning or end of the value.

{{issue.summary.trim()}} -> Hello World!

For more information, see: String.trim().

urlEncode()

Encodes text to allow them to be included as a URL param, for example, a link in an email.

{{issue.summary.urlEncode}} -> See Encoding below.

xmlEncode()

Encodes text to allow them to be included in XML data, for example, an outgoing webhook.

{{issue.summary.xmlEncode}} -> See Encoding below.

Encoding

When integrating with other systems or sending emails, you may need to encode the text to comply with standards or not break things. For example, if you are sending an HTML email, you may need to encode an issue's description as HTML. This escapes specific characters to comply with the HTML specifications.

Html encoding

HTML encoding is useful for emails and exporting HTML pages. For example, Waiting for R&D would be encoded as Waiting for R&amp;D.

// Function
{{#htmlEncode}}{{issue.status.name}}{{/}}

// Inline version
{{issue.status.name.htmlEncode}}

Json encoding

Useful when sending outgoing webhooks as JSON. For example, "Hello World" would be encoded as \"Hello World\".

// Function
{{#jsonEncode}}{{issue.summary}}{{/}}

// Inline version
{{issue.summary.jsonEncode}}

URL encoding

Useful when sending creating links in emails. For example, Hello & World would be encoded as Hello%20%26%20World.

// Function
{{#urlEncode}}{{issue.summary}}{{/}}

// Inline version
{{issue.summary.urlEncode}}

Xml encoding

Useful when sending Outgoing webhooks as XML. For example, Hello & World would be encoded as Hello &amp; World.

// Function
{{#xmlEncode}}{{issue.description}}{{/}}

// Inline function
{{issue.description.xmlEncode}}