Labels Aren't Retrieving Owners When Using Remote API

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

The Confluence API method getLabelsByDetail(null, null, null, AuthenticatedUserThreadLocal.getUsername()) returns empty results.

Cause

The method getLabelsByDetail() is actually looking into LABEL table, instead of CONTENT_LABEL.

As you are trying to retrieve Global Labels that a user has added (by passing in the owner name), it is an expected behavior that empty result is returned. The Global Label's owner is not recorded in the LABEL table.

Resolution

Labels are stored in the following tables:

  • CONTENT_LABEL
  • LABEL

In CONTENT_LABEL, it stores the usage of a label ( e.g where does a label belongs to). You can find the label OWNER who created the label in this table.

However, LABEL stores the label's properties (e.g : owner of a personal label, label's namespace) and it stores unique label. As you can notice from LABEL, global (namespace) label does not have OWNER recorded. That's because, the same label (global label) can be used across different pages. In another words, that could be different author/owner of the same label. Thus, the author/owner is recorded in CONTENT_LABEL table instead of LABEL.

Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.