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)
/
How to create a Scripted Pre-Processing Task
Updated Jan 24

    How to create a Scripted Pre-Processing Task

    • 1 Summary
    • 2 How to use
      • 2.1 Adding a Test Case
      • 2.2 Using the Test Script
      • 2.3 Test Script examples

    Summary

    The Scripted Pre Processing Task allows you to change message with a Velocity or ECMA Script (aka Javascript). 

    The objective of the scripted task is to modify the message before running the standard JEMHCloud process.

    Velocity templating language and Javascript are available but Javascript is recommended.

    Some technical ability is needed to create and maintain scripts you create!

    How to use

    1. Pick the type

    2. Pick the Test Case

    3. Make some asserts (language specific format) on the outcome

    Adding a Test Case

    A Test Case can be added by either creating your own email within the Test Case box or by selecting an existing Test Case from the Load Test Case list.

    Using the Test Script

    a value of ; is sufficient to void the need for testing!

    A way to verify that your email is being modified as expected is creating a Test Script that tests your main script. The test script will assert how the test case email looks after your script is executed against it. The test script is composed of a list of assertions. An assertion is a condition that needs to be true in order to pass.

    You can test the script before saving by pressing the validate button. This will allow you to solve any issues before saving the change. If you attempt to save a script which contains issues, these issues will be reported and you will not be able to save your script until you have resolved them.

    It's highly recommended to test your script by adding many assertions to verify it works properly. If an assertion fails, the error below the script editor will show you the line and column number in the script that is failing. The presence of a Test Script is required.

    Test Script examples

    For Velocity examples, see Velocity Scripted Pre-Processing Examples.

    For ECMA Script examples, see ECMA Script Scripted Pre-Processing Examples.

    The Plugin People
    Teams
    , (opens new window)

    Enterprise Mail Handler for Jira Cloud (JEMHC)
    • Getting started
      Getting started
       This trigger is hidden
    • Documentation
      Documentation
       This trigger is hidden
    • Licensing
      Licensing
       This trigger is hidden
    • How-to articles
      How-to articles
       This trigger is hidden
    • Common Problems
      Common Problems
       This trigger is hidden
    • Support
      Support
       This trigger is hidden
    • Migrating from Server/DC to Cloud
      Migrating from Server/DC to Cloud
       This trigger is hidden
    • Frequently Asked Questions
      Frequently Asked Questions
       This trigger is hidden
    • General Data Protection Regulation (GDPR)
      General Data Protection Regulation (GDPR)
       This trigger is hidden
    Results will update as you type.
    • What is JEMH Cloud?
    • App documentation
      • Getting started
      • Profiles
        • Creating Profiles
        • Profile Configuration
          • Preprocessing Tasks
            • How to create a Scripted Pre-Processing Task
              • Velocity Pre-Processing Task Examples
              • JavaScript Pre-Processing Examples
        • Profile Advisories
        • Project Mappings
        • Project Mapping Tester
        • Profile Auditing
      • Messaging
      • Global Exclusions
      • Notifications
      • Test Cases
      • Tools
      • Licensing
      • Auditing
      • Workarounds
      • Release Notes
      • Blog
      • Project Settings Configuration
      • Workflow Post Function Notifications
    • How-to articles
    • Common Problems
    • App licensing
    • General Data Protection Regulation (GDPR)
    • Maintenance Windows
    • Security
    • Notices
      Calendars
    You‘re viewing this with anonymous access, so some content might be blocked.
    {"serverDuration": 11, "requestCorrelationId": "f21772a2c13d45fb9d4bbeb6856a44e5"}