Project labels


List labels for a project:

labels = project.labels.list()

Create a label for a project:

label = project.labels.create({'name': 'foo', 'color': '#8899aa'})

Update a label for a project:

# change the name of the label:
label.new_name = 'bar'
# change its color:
label.color = '#112233'

Delete a label for a project:

# or

Manage labels in issues and merge requests:

# Labels are defined as lists in issues and merge requests. The labels must
# exist.
issue = p.issues.create({'title': 'issue title',
                         'description': 'issue description',
                         'labels': ['foo']})

Label events

Resource label events keep track about who, when, and which label was added or removed to an issuable.

Group epic label events are only available in the EE edition.


Get the events for a resource (issue, merge request or epic):

events = resource.resourcelabelevents.list()

Get a specific event for a resource:

event = resource.resourcelabelevents.get(event_id)