by fbourget » Fri Jan 14, 2011 7:06 pm
Hello,
Thanks a lot for these very useful examples.
Another request: I would like to fill "Priority" during mail submission process.
I write script below, but it doesn't work, "Priority" is always empty. I check with a trace, value of "priorityMat.group(1)" is OK.
String fieldName = "Priority";
String text = task.getDescription();
if (text != null && text.length() > 0) {
String priorityPattern = fieldName + ":\\s*(.+)";
Pattern priorityPat = Pattern.compile(priorityPattern);
Matcher priorityMat = priorityPat.matcher(text);
if (priorityMat.find()) {
String value = priorityMat.group(1);
task.setPriority(value);
}
}
Can you, please, help.
Thanks and regards