Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy Change Issue Type

Abdul June 25, 2020

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.

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events