Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get all space categories in Confluence via API

Roy Lu July 22, 2019

Hi,

Is there a way to list all the space category labels in a Confluence instance using Confluence API?

Best,

Roy

1 answer

1 vote
Ron Elazar
Contributor
April 26, 2021

import com.atlassian.confluence.labels.LabelManager
import com.atlassian.confluence.pages.PageManager
import com.atlassian.sal.api.component.ComponentLocator

def labelManager = ComponentLocator.getComponent(LabelManager)
def pageManager = ComponentLocator.getComponent(PageManager)
def spaceKey = pageManager.getPage(1234).getSpaceKey()

def result = labelManager.getLabelsByDetail("","team",spaceKey,"") 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events