Example scripts
To homepage
Jira

Bulk Create Components in a Project
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira (8.12 - 8.22)

ScriptRunner For Jira (7.5.0)
Language |
groovy
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.AssigneeTypes
def projCompManager = ComponentAccessor.projectComponentManager
def projManager = ComponentAccessor.projectManager
def components = ['User Interface (UI)', 'Database', 'API', 'Security', 'Analytics', 'Messaging', 'Infrastructure', 'Company Website / Blog', 'YouTube Videos', 'Web Advertising', 'Partner Websites', 'Networking', 'Systems', 'Software', 'Hardware']
def username = 'admin'
def projKey = 'KP'
def projectId = projManager.getProjectByCurrentKey(projKey).id
def leadUser = ComponentAccessor.userManager.getUserByName(username).key
components.each { component ->
projCompManager.create( component, null, leadUser, AssigneeTypes.PROJECT_DEFAULT, projectId)
}Having an issue with this script?
Report it here