The script will be a post function in Create transition
If Label == STAR, assignee should be Able Brown
If Label == SIMULS, assignee should be Charlie F Dern
If Label == HELO, assignee should be Evan CTR Faulks
Else, assignee == component lead
FAILED #1- Made Assignee the Project Lead (No errors occur when compiling or during transition)
import com.atlassian.jira.component.ComponentAccessor
def containsLabel = "STAR" in issue.getLabels()*.label
if ( containsLabel )
{ issue.setAssigneeId('Able Brown') }
else {
containsLabel = "SIMULS" in issue.getLabels()*.label
if ( containsLabel )
{ issue.setAssigneeId('Charlie F Dern') }
else {
containsLabel = "HELO" in issue.getLabels()*.label
if ( containsLabel )
{ issue.setAssigneeId('Evan CTR Faulks') }
else
{ issue.setAssignee(null) }
}
}
FAILED#2 - Issue remains unassigned (No errors occur when compiling or during transition)
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.user.ApplicationUser
MutableIssue issue = issue;
def containsLabel = "STAR" in issue.getLabels()*.label
if ( containsLabel )
{ issue.setAssigneeId('Able Brown') }
else {
containsLabel = "SIMULS" in issue.getLabels()*.label
if ( containsLabel )
{ issue.setAssigneeId('Charlie F Dern') }
else {
containsLabel = "HELO" in issue.getLabels()*.label
if ( containsLabel )
{ issue.setAssigneeId('Evan CTR Faulks') }
}
}
The project needing this uses both labels and components. First I have the post function to assign the issue to the component lead, but if there is a specific label, it has to be assigned to someone else on the team. Basically the labels are being used as a subset of the components, as far as I can ascertain.
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.