I may overlook the answer but I don't seem to find an example about this.
Question:
a mail is processed (JEMH), but in a certain defined profile I want to change the summary field with something I extracted from the body.
Technically:
I installed JEMH and already configured several profiles and scripts and more....
The mail is captured by the correct profile and with a regular expression I am filtering a custom field out of it , eg: MyField = 1234
But now I want that field to be added to the summary title of the new ticket to be created.
like: summary = summary + " - " + MyField
Resulting in: "This is the original title - 1234"
I found articles referring to directives like : JEMH & directives
but I don't have (and don't want) those in my mail body because I already have my "Custom Field" with the content ready.
Is this possible?
thanks
Hello,
a mail is processed (JEMH), but in a certain defined profile I want to change the summary field with something I extracted from the body.
The Regexp Field Processor could be used to extract content from the email body, and then set the summary with that content.
Here is an example configuration (ignore the error message at the top - its a known bug!):
the regular expression (regexp) used will of course need to match the content in the email that you want to use in the summary!
Hi Mike, yes that's where I am stranded.
I have that regular expression and have it parsed into a custom field.
But now, how do you concatenate the current title with that field?
So not just a replace.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are using JEMH 2.5.1 or newer, you have access to the Script Field Processor. This allows more freedom in getting JEMH to do exactly what you want.
The following script extracts a value from the email body using a regular expression, and puts the value on the end of the summary. All of this only happens if the email relates to an existing issue:
if (relatedIssue) {
var regex = /value:\s?([^\n]+)/;
var found = body.match(regex);
var value = "";
if (found.length > 1) {
value = found[1];
}
if (value.length > 0) {
resultMap.put("summary", relatedIssue.getSummary() + value);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.