Forums

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

Import com.atlassian.jira.component.ComponentAccessor

Manoj
Contributor
January 12, 2023

hi,

Import com.atlassian.jira.component.ComponentAccessor

This could be a silly question, but could someone help to know what exactly this is and how does it work.

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
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 Leaders.
January 13, 2023

You don't really need to know the deep detail of it, I suspect you are asking because you keep seeing it in scripts.

All it really does is give a script a way to create the "manager" type objects that they almost always need.

For example, if I want to do something with projects, like get a list of archived ones, I'll probably need a projectManager.  So I'd call ComponentAccessor.getProjectManager to create one to work with in my script.

If you have a rummage through https://docs.atlassian.com/software/jira/docs/api/9.5.0/com/atlassian/jira/component/ComponentAccessor.html you'll see that almost all the calls are "get manager or factory object" or "get block of info that doesn't really have a manager" in a few cases.

Manoj
Contributor
January 14, 2023

@Nic Brough -Adaptavist- Hello, 

Thanks for explaining above, as this is something new for me, I was bit not sure about my understanding on above, but your explanation clear my doubt. 

Thanks 

M. 

Suggest an answer

Log in or Sign up to answer