This template displays all email addresses mentioned in the description of the current work item.
If there is nothing to display, the result will be “None”.
Configuration
To use the Email addresses in work item description template, simply select it from the template grid. Filter by Misc to find it faster.
Parameters
This template does not require any additional parameter configuration.
Expert mode
If you switch to Expert mode you can see the formula field in the Expression Parser. You can now tweak the expression to create a custom formula field based on this template.
Expression
General expression:
%{findPattern(%{issue.description},"(?<=mailto:)([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)")}
Used parser functions
The links lead to the JWTC documentation because the parser functions are shared functionalities.
Details
1. What does the expression do?
This expression extracts and displays all email addresses mentioned in the description field of the current work item.
2. Step-by-step breakdown
Let’s break it down:
-
%{issue.description}: This part retrieves the text from the description field of the current work item. -
findPattern(...): This function searches for text that matches a specific pattern (using regular expressions) within the provided input. -
"(?<=mailto:)([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)": This is the regular expression pattern used to find email addresses that are preceded by "mailto:".
3. Examples
-
If your work item description contains:
Contact us at [mailto:support@example.com].
The expression will extract and display:
support@example.com -
If there are multiple mailto links, such as:
[mailto:info@example.com] or [mailto:help@domain.org]
The result will be:
info@example.com, help@domain.org
4. Real-life use cases
-
Contact extraction: Automatically list all contact email addresses from work item descriptions for easy reference or reporting.
-
Data migration: When migrating data, quickly identify and extract all email addresses for notification or update purposes.