Forums

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

Automatic Assignment of Issues to Components

Dave Frohwitter
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 5, 2019

Is there a way for an issue to automatically be assigned to a specific Component at creation?  Can it be based on the Epic Link?

Thanks,
Dave

1 answer

0 votes
Jean-Théo [Adaptavist]
Community Champion
March 5, 2019

Hi @Dave Frohwitter ,

This is not possible with out of the box JIRA. It is possible to set a fixed Component, but not one that follows a condition!

The only way to do this would be to use a plugin like Scriptrunner and create a script listener.

Here is an example : 
https://community.atlassian.com/t5/Jira-questions/set-Component-in-groovy-script/qaq-p/196655

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.util.ImportUtils
import com.atlassian.jira.user.util.DefaultUserManager
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.project.Project 

MutableIssue issue = issue

Project project = issue.getProjectObject()

def component = componentManager.getProjectComponentManager().findByComponentName(project.getId(),'ComponentName')

issue.setComponentObjects([component])

Hope this helps, let me know if you decide to proceed with this solution and need further help with the script.

JT

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events