Hi,
"Problem Description":
We get Maintenance Mails from our Service Provider. Quite many. All Mails start with a Ticket Number from our Service Provide "CS1234567". We get a Mail for starting maintenance and when there are problems or when it is resolved.
Right now my Mail Handler creates everytime a new Ticket with the eMail Subject as Summary. eg:
Internal Ticket (issue key) DC-87
Summary "CS1561207 - DE.FRA6 - Communication - Maintenance"
So now I get a new email with the same CS# and I want to search for the Issues in the project with that number.
I got the "function" for creating a substring out of that email subject and I saved it as a variable
def subjectMatch = "CS\\d*"
def subject = message.subject as String
def substringCS = (subject =~ subjectMatch)
but I do not know how to search now for that string in the summaries.
I tried the solution from the adaptavist library which should compary the subject of a new email with the current issues. However I think it searches for the ID "DC-87"
def issue = ServiceUtils.findIssueObjectInString(subject)
if (issue) {
// issue already exists so do nothing
return
}
But the value of "issue" is always 'null'
As I saw in the Jira API documenation this one is depreciated by now, however it is still an example in the library.
Unfortunately it is not possible for me to use the Jira Ticket Number for searching, since these emails come directly from the maintenance system of our supplier.
Does anybody know how I can use the string "subjectstringCS[0]" for a search in the summary of the issues?