// the issue key of the issue to update its labels
final String issueKey = "JRA-1"
// change to 'false' if you don't want to send a notification for that change
final boolean sendNotification = true
// have this true in order to throw an issue update event, and reindex the index
final boolean causesChangeNotification = true
// a list with the labels we want to add to the issue
final List newLabels = ["label_a", "label_b"]
def issueManager = ComponentAccessor.issueManager
def labelManager = ComponentAccessor.getComponent(LabelManager)
def issue = issueManager.getIssueByCurrentKey(issueKey)
assert issue : "Could not find issue with key $issueKey"
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def existingLabels = labelManager.getLabels(issue.id)*.label
def labelsToSet = (existingLabels + newLabels).toSet()
labelManager.setLabels(loggedInUser, issue.id, labelsToSet, sendNotification, causesChangeNotification)