Environment:
JIRA v7.4.4,
ScriptRunner 5.3.5
Using "Clone an issue, and link" to create up to 50 product specific issues, and need to automatically populate a custom label field named "Agile Team" with the team that is responsible for that product area. Already using Additional issue action" to customize a numbers of fields (Summary, Component, a Cascading Select, Watcher, Assignee) , based on the specific product area, but cannot find a recipe for populating a Custom Label field. Below is an example of what is already working.
Thanks,
Wayne
import com.atlassian.jira.ComponentManagerimport com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.project.Project
import com.atlassian.jira.user.util.UserManager
import com.atlassian.jira.issue.watchers.WatcherManager
def project30 = issue.getProjectObject()
def componentManager = ComponentManager.instance
def optionsManager = ComponentManager.getComponentInstanceOfType(OptionsManager.class)
def userUtil = ComponentAccessor.getUserUtil()
MutableIssue issue = issue
def projectComponentManager30 = ComponentAccessor.getProjectComponentManager()
def newcomponent30= projectComponentManager30.findByComponentName(project30.getId(), "Ethernet RG")
issue.setComponent([newcomponent30])
String SUMMARY_VALUE30 = issue.summary
String newSummary30 = "Security Vulnerability (OEM RG/AP (Inteno)) - "+SUMMARY_VALUE30
def customFieldManager3011 = ComponentAccessor.customFieldManager
def optionsManager3011 = ComponentAccessor.optionsManager
def issueManager = ComponentAccessor.issueManager
def productCat3011 = customFieldManager3011.getCustomFieldObjectsByName("Product Category")[0]
def fieldConfig = productCat3011.getRelevantConfig(issue)
def options = optionsManager3011.getOptions(fieldConfig)
def parentOption3011 = options.find { it.value == "Ethernet RG" }
def childOption3011 = parentOption3011?.childOptions?.find { it.value == "" }
def newValues = [:]
newValues.put(null, parentOption3011)
newValues.put("1", childOption3011)
issue.setCustomFieldValue(productCat3011, newValues)
issue.assigneeId = "rmenakat"
issue.summary = newSummary30
checkLink = {link -> false};