I am trying to connect components to assignee such that when I assign an issue to someone the component will be auto-assigned. The system is built such that each person belongs to a group which translates into component in the front end.
I feel like even script won't be much help here, since ProjectComponentManager.update() throws an error and it seems like a known bug. So I guess even plugin with such functionality might not exist since as far as I understand it would still use atlassians java api.
I guess I will stick to the reverse that we currently have. Thank you for your response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure if @Tomas Gustavsson answer is what you're looking for. With the component lead you assign the component and the component lead is automatically assigned. It sounds like you want to assign an issue to someone and have the component assigned. Do you want that behaviour to carry forward for each time an issue is reassigned? If so you can't do it without a script or plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Joe Pitt this is exactly what I want. I am fine if it does not carry forward for now. Do you know how I can work around it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You would need a script (I don't do those) or a plugin. The problem you're going to have is maintaining it. Everytime the users change you'll need to update the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes that should be possible, with setting a component lead
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
alright, it's kinda feels dumb now, but I got it working:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.bc.project.component.MutableProjectComponent
def issueComponents = issue.components
if (!issueComponents || !issue.assignee) {return}
def component = ComponentAccessor.projectComponentManager.find(issueComponents[0].id)
def mutableComponent = MutableProjectComponent.copy(component)
mutableComponent.setLead(issue.assignee.name)
ComponentAccessor.projectComponentManager.update(mutableComponent)
so if you have a scriptrunner and insert it into a postfunction on some transition or listener and listen to issueAssigned event it should work, tho some tuning definitely might be one, thats just a raw core
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.