Hi All,
I have a scenario where the default issue type is "TBD".
The issue gets created via an incoming email. In my script I check for a text pattern.
If I find it I need to set the issue type.
If patternMatch = true
{
def newIssueType = ComponentAccessor.issueTypeSchemeManager.getIssueTypesForProject(issue.projectObject).find{it.name=="ABC"}
if (newIssueType) issue.setIssueTypeObject(newIssueType)
ComponentAccessor.issueManager.updateIssue (currentUser, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
}
else
{
def newIssueType = ComponentAccessor.issueTypeSchemeManager.getIssueTypesForProject(issue.projectObject).find{it.name=="XYZ"}
if (newIssueType) issue.setIssueTypeObject(newIssueType)
ComponentAccessor.issueManager.updateIssue (currentUser, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
}
My issue now is that irrespective of patterMatch, the issueType is always set to "TBD".
May I request you to please advise how do I set the Issue Type based on patterMatch.
Thanking you in advance.