Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Confluence-Prod

Field Extractor for Jira (FEJ)
Results will update as you type.
  • Field Extractor for Jira Cloud Documentation
  • Field Extractor for Jira (FEJ) Server/DC Documentation
    • Getting Started with FEJ
    • Configuring the Plugin
    • Guidelines for Adding Pattern Mappings
      • How to add Rules with Basic Pattern
      • How to add Rules with Regex pattern?
    • FEJ DC - Exporting and Importing Rules
    • How to Check the FEJ Logs
    • FAQs - Frequently Asked Questions
    • FEJ Release Notes
  • EULA
  • Privacy Policy

    Company hub
    , (opens new window)
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    How to add Rules with Regex pattern?
    Updated May 22, 2024

      How to add Rules with Regex pattern?

      Use the check box highlighted below in the Create/ Edit or Clone dialogue to enable Regex mode for a particular rule item.

      Next, provide a regex pattern in the ‘Pattern’ input. PFB is an example.

      When in action, the input rich text field would be checked against the regex pattern for a match, if a match is found the same would be updated to the ‘Priority’ field in Jira.

      Regex Helper

      We recommend to Visit the 'Manage Apps’ → ‘Regex Helper' module in your Jira to test Regex patterns against input texts before using them in Rules.

      The Regex Helper tool is designed to assist users in performing regular expression matches on input data. Users can input a valid regular expression and a set of data, and the tool will automatically perform the match.

      Valid Regular Expression:

      Crafting a valid regular expression requires precision in considering the pattern's structure and matching criteria. Successful matches, shown in blue, exemplify the data to be inserted into the custom field on the issue page, while red highlights indicate mismatches.

      In this example, the given regex pattern is returning a value ‘High’ based on the input data. Once the same pattern is used in a Rule as shown below, the rule can set the field ‘Priority’ as ‘High’.

      Invalid Regular Expression or Input Data:

      When the regular expression is invalid or a regex match is NOT found in in the Input Data, a corresponding error message is shown in Red color. Tweak the regex/ input data to get a success output before using it in a actual rule.


      Clearing Input Fields:

      To clear the input fields, entered values in both the "REGULAR EXPRESSION" and "INPUT DATA" fields, and then click the "Cancel" link. This action will swiftly reset both fields, providing a convenient way to start fresh.

      Sample regex patterns for reference:

      Guide on regex patterns! Below, you'll find a collection of sample regular expressions (regex) to help you validate and extract phone numbers from text etc….

      Input Data

      Input Data

      priority=High
      name=ABC
      profile=ABC,
      more details here,
      Thank you.
      assign=admin@admin.com

      Priority Extraction:
      Regex: priority\s*=\s*(\S+)

      Extracted Value: High

       

      Name Extraction:

      Regex: name\s*=\s*([a-zA-Z]+)

      Extracted Value: ABC

       

      Profile Extraction (up to 3 lines):
      Regex: profile=(.(?:\n(?![a-z]+=).)*)
      Extracted Value: ABC,
      more details here,
      Thank you.

       

      Email Address Extraction:
      Regex: assign\s*=\s*([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})

      Extracted Value: admin@admin.com

      Phone Number Extraction:
      Regex: phone\s*=\s*(\+?[0-9\s-]+)

      Extracted Value: +1234567890




      {"serverDuration": 37, "requestCorrelationId": "46a563493b37494a91acb15d4c971580"}