Hello
I'm going to use Scriptrunner's post function function.
When the status changes after the ticket is issued, I want to automatically register the user with the user picker by putting the person in charge of the component in the user picker.
Is this possible? below is the script.
package com.onresolve.jira.groovy.test.scriptfields.scripts
import com.atlassian.jira.component.ComponentAccessor
import org.apache.log4j.Logger
import org.apache.log4j.Level
import com.atlassian.jira.user.ApplicationUser
def log = Logger.getLogger("com.acme.curvc")
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def componentManager = ComponentAccessor.projectComponentManager
def userCf = customFieldManager.getCustomFieldObject(12823L) // Developer
def component = issue.componentObjects.toList()
def leadUser = component.componentLead.username
log.debug("test : " + leadUser[0])
if(component.size() == 1){
issue.setCustomFieldValue(userCf, leadUser[0])
}
else if(component.size() > 1){
issue.setCustomFieldValue(userCf, leadUser[0])
}
else{
return "none component"