• Products
  • Get started
  • Documentation
  • Resources

String processing methods

This article highlights a new alerting feature that's natively available in Jira Service Management which is gradually rolling out to some Jira Service Management Cloud customers. It may not yet be visible or available on your site.

Jira Service Management provides string processing methods to parse incoming emails in email to alert rules, automation, etc.

Jira Service Management email rules allow processing these emails, extracting information from email data, assign to appropriate alert fields, and take the appropriate action (create, acknowledge, close, etc.) To extract data from incoming emails, Jira Service Management provides string processing methods. The following methods are currently supported:

toLowerCase(): converts all the characters within the text to lowercase and returns the resulting string

{{message.toLowerCase()}}

toUpperCase(): converts all the characters within the text to upper case and returns the resulting string

{{message.toUpperCase()}}

substring(int from), substring(int from, int to): returns the string between specified indices. "from" is included "to" is excluded.
{{from_name.substring(5,20)}}

substringAfter(String from): returns the string after the specified parameter

{{subject.substringAfter("Host")}}

substringBefore(String to): returns the string before the specified parameter
{{from_address.substringBefore("@")}}

substringBetween(String from, String to): returns the string between from and to parameters
{{subject.substringBetween("URL:","(")}}

extract(regular expression): returns part of the string that matches the parenthesized section of the regular expression.
{{message.extract(/Host: (\S+)/)}}

Read more about the extract method.

Regex match operations has 10 seconds timeout limit. If it takes more than 10 seconds, it returns "null"string.

toDate(): returns date time conversion of a timestamp. Uses default values of "yyyy-MM-dd HH:mm:ss ZZZ" for time date format; "GMT" for time zone.
{{message.toDate()}}

toDate(String dateTimeFormat): returns date time conversion of a timestamp. Time format argument should follow the Java's Simple Date formatting pattern. Uses default value of "GMT" for time zone.
{{message.toDate("yyyy-MM")}}

Read more about Java's Simple Date formatting pattern.

toDate(String dateTimeFormat, String timeZone): returns date time conversion of a timestamp. Time format argument should follow the Java's Simple Date formatting pattern.
{{message.toDate("yyyy-MM", "GMT+2")}}

Read more about Java's Simple Date formatting pattern.

toReadableNumber(): Removes the + characters if exists and splits all the characters within the given string by single whitespaces. Applying this method to phone numbers within alert messages is the most common case to be able to listen each digit within phone numbers one by one.
{{from.toReadableNumber()}}

removeAllWhitespace(): Removes any white space, new line, tab and carriage return characters from the specified parameter and returns the resulting string.
{{message.removeAllWhitespace()}}

urlEncode(): Converts a string to the application/x-www-form-urlencoded MIME format, based on the UTF-8 character set. Read more about special characters in URI attribute values.
{{subject.urlEncode()}}

Still need help?

The Atlassian Community is here for you.