The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

ComponentAccessor in Confluence?

Kyrre Kristiansen
Contributor
August 28, 2014

I've been using the Script Runner plugin in Jira for pretty much anything under the sun. It's really a great plugin for finding out details about the running Jira instance, and I've worked up quite a collection of scripts that I use more or less frequently.

I've installed the Script Runner (3.0) on our Confluence instance, and I'm having less luck.

The API's seem to be quite different, and I am struggling to get a "way in", so to speak.

In Jira, all things start from the ComponentAccessor. Is there a similar component in Confluence?

I do most of the scripting in the scripting console.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

6 votes
Answer accepted
Kyrre Kristiansen
Contributor
August 28, 2014

After some heavy googling, I found the com.atlassian.spring.container.ContainerManager, which seems to be what I'm looking after. For example, trying to fetch the pageManager from the script console, use the lines:

import com.atlassian.spring.container.ContainerManager
ContainerManager.getInstance().getComponent("pageManager")

Which will return the page manager for general use and abuse :-D

2 votes
Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
September 16, 2016

The com.atlassian.sal.api.component.ComponentLocator class may actually be the nearer equivalent.

TAGS
AUG Leaders

Atlassian Community Events