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)
The Plugin People
Teams
, (opens new window)

Enterprise Mail Handler for Jira Data Center (JEMH)
  • First time Install - two minute quickstart
    First time Install - two minute quickstart
     This trigger is hidden
  • How-to articles
    How-to articles
     This trigger is hidden
  • How Do I....
    How Do I....
     This trigger is hidden
  • Licensing
    Licensing
     This trigger is hidden
  • Migrating from Server/DC to Cloud
    Migrating from Server/DC to Cloud
     This trigger is hidden
  • Common Problems
    Common Problems
     This trigger is hidden
  • Technical Details related to data usage
    Technical Details related to data usage
     This trigger is hidden
  • The Plugin People Knowledge Base
    The Plugin People Knowledge Base
     This trigger is hidden
  • JEMH App Documentation
    JEMH App Documentation
     This trigger is hidden
Results will update as you type.
  • 1 - What is JEMH
  • 2 - Configuring JEMH
  • 3 - Licensing
  • 4 - Reporting Issues with JEMH
  • 6 - Supporting Information
  • 7 - Development & Automation
  • 8 - Roadmap
  • 9 - Bootstrap Profile examples
  • 10 - JEMH Application Docs
    • Profiles
      • Creating a Profile
      • Profile Advisories
      • Profile Security
      • Email Section
      • Project
      • Message Filters
      • User
      • Allowlist
      • Issue
      • Profile Notifications
      • Aliases
      • Use Directives
      • JEMH Mail Field Processors
        • Example MailFormNg format inbound Emails
        • Generating tickets from Confluence into Jira using Forms for Confluence
        • Use Regexp Field Processor
        • Use Script Field Processor
          • Install a Scripting runtime Engine (Nashorn, Groovy, Graal)
            • Installing Nashorn (ECMAScript) Script Engine
            • Installing Groovy Script Engine
            • Installing Graal Script Engine
          • Defining message outcomes
          • Useful scripts
          • Performing HTTP requests
          • Check for/Drop duplicate issues with same Sender, Summary and Description
        • Use Nagios Field Processor
      • Project Mapping
    • Features
    • Blocklisting
    • Use Static Resources
    • Template Sets
    • Test Cases
    • Notifications
    • Use LDAP to create and lookup users
    • Use Auditing
    • Extensions
    • Diagnostics
    • Licensing
    • Project Settings configuration
    • Limits
  • How-to articles
  • Upgrading
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    Installing Nashorn (ECMAScript) Script Engine
    Updated Aug 22

      Installing Nashorn (ECMAScript) Script Engine

      • 1 Summary
      • 2 Install Into JDK17+ - Recommend Method
      • 3 Install directly into JIRA_INSTALL_DIR/lib not recommended

      Summary

      Within Java 8 and Java 11 Nashorn (ECMAScript) is included by default which means that you do not need to install Nashorn into Java/Jira in order to use the JEMH Scripting features.

      If you are using Java 17+ then you will see that Nashorn (ECMAScript) is not included by default. Due to this it means that you would need to download and install the relevant Nashorn files to use the JEMH Scripting features. See below for two methods of how to install Nashorn.

      Install Into JDK17+ - Recommend Method

      This method is recommended as it provides a more seamless support for your existing scripts where Jira components are used through Java.type(“nnnn”).

      1. Download the Relevant Nashorn files, can be downloaded by using the following (see Central Repository: org/openjdk/nashorn/nashorn-core for the latest version):

      wget https://repo1.maven.org/maven2/org/openjdk/nashorn/nashorn-core/15.4/nashorn-core-15.4.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm/9.6/asm-9.6.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm-util/9.6/asm-util-9.6.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.6/asm-analysis-9.6.jar
      1. Place these downloaded files into $JAVA_HOME/jmods

      2. Run the following script to create a new Java Runtime Environment with all of the Java Modules (including the newly added modules):

        1. jlink --module-path $JAVA_HOME/jmods/ --add-modules ALL-MODULE-PATH --output jre
      3. Update $JAVA_HOME to point to the new JRE folder.

      You should then see that ECMAScript (Nashorn) is listed as a Detected Script Engine within JEMH > Extensions > Detected Script Engines

      Screenshot from 2024-01-03 11-26-46.png

      Install directly into JIRA_INSTALL_DIR/lib not recommended

      Known Issues

      If you are using Java 17 (and its related compatible JEMH version JEMH 4.1.2+) this method works in terms of simple javascript evaluation but has problems where Jira components are used (eg Java.type(“nnnn”)) that break. If you encounter problems, log a support ticket and supply your script, highlighting this case: https://thepluginpeople.atlassian.net/servicedesk/customer/portal/1. We can work with you to solve this, some script are likely required.

      the above method (Install Into JDK) does work correctly.

       

      With this method of installing the additional scripting languages you will need to provide the relevant scripting jars into the Lib folder every-time you conduct a Jira upgrade. Using the method above (Install into JDK) means that you will only need to install these languages once. (As long as you are using the same Java version for the new instance)

      1. Download the Relevant Nashorn files, can be downloaded by using the following (see Central Repository: org/openjdk/nashorn/nashorn-core for the latest version):

      wget https://repo1.maven.org/maven2/org/openjdk/nashorn/nashorn-core/15.4/nashorn-core-15.4.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm/9.6/asm-9.6.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm-util/9.6/asm-util-9.6.jar wget https://repo1.maven.org/maven2/org/ow2/asm/asm-analysis/9.6/asm-analysis-9.6.jar
      1. Copy these downloaded files into your <jira_install_directory>/lib folder

      2. Restart Jira

      You should see that ECMAScript (Nashorn) is listed as a detected Language within JEMH > Extensions > Detected Script Engines

      Screenshot from 2024-01-03 11-26-46.png

       

      {"serverDuration": 11, "requestCorrelationId": "403794e3172542cea03123f5216687e3"}