since 3.3.42
Please refer to the Pre-Processing Task page for setting up and configuring Pre-Processing Tasks: How To Use Pre-Processing Tasks |
After enabling Script Task, return to the profile configuration page and select the edit (pen) icon for Script Task.
The edit icon launches the pre-proc script editor.
All Script Engines and Languages installed that can process Scripts. For more information on adding new Scripting Engines, please see: Installing a Scripting runtime Engine like Groovy
A CSV list of headers that can be processed and altered by the Script Pre-Processing task. This includes new headers you want to add.
The Script that will be run as a Pre-Processing task. Using the “Preview HeaderScript” button will run the script using the provided values and displayed below.
A list of all Test Cases that are linked to the given Profile, allowing them to be evaluated and for changes to be seen at edit time (next).
Evaluates the Header Script against the selected Test Case. The result of the script test will be shown below the existing form.
Matching Headers:
subject,x-subject |
Script:
var subject = headerBeans.get('subject').getOriginalVal(); var hdr = jemhUtils.addPreProcHeader("x-subject", "NEW "+subject); print('new header: '+hdr.getUpdatedVal()); headerBeans.put("x-subject", hdr); |
Console Output - displays the console result of the script, driven by the print('….') method:
Affected Headers will show changes and additions:
$jemhUtils == http://ppl-docs.s3-website-us-east-1.amazonaws.com/JEMH/3.3.80/com/javahollic/jira/emh/api/IJEMHVelocityContextUtils.html
$headeBeans == https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html
preProcHeader class == http://ppl-docs.s3-website-us-east-1.amazonaws.com/JEMH/3.3.80/com/javahollic/jira/emh/api/preproc/PreProcHeaderBean.html
headerBeans expects Lower case key, i.e. ‘subject’, ‘content-type’, etc. |
Method | Used for | Example | |
---|---|---|---|
jemhUtils.getOriginalAddressees() | Retrieving To/Cc/Bcc/From/Delivered-To Header Values | Retrieving addresses from a specific header to compare against or edit:
| |
jemhUtils.updatePreProcHeader() | Updating To/Cc/Bcc/From/Delivered-To Header Values | Updating the Sender From address:
| |
headerBeans.remove(“cc”) | Removing Headers | Removing unwanted Cc address:
| |
jemhUtils.createInternetAddress(“nn”) | Creating a new Recipient to add to Header | Inserting a Bcc header:
| |
aHeaderBean.getOriginalVal() | Non-Recipient Header values | Retrieving the Subject Header:
| |
aHeaderBean.setUpdatedVal(“nnnn”) | Non-Recipient Header values | Changing the Subject Header:
|
We are currently gathering interest in this Feature. Please see JEMH-7508 for updates. |