Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

List of Project Components

Carl Nolan
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.
May 14, 2012

Hi,

Should be a quick question. Searching showed nothing.

I'm writing a Jira gadget and I need to get a list of all the available "Components" for a project using its ID to populate a select box. I think it has something to do with FieldManager but I don't know where to go from there. Anyone know how I'd do that? Either from the gadget javascript side or the REST resources in Java.

Thanks,

Carl

Oh also: sub-question. I need the select box with the components to change whenever a different project is selected in the config screen (both the select box and the project selector are on the config screen). I was planning to use some javascript to solve this problem once I get the above working. Am I working in the wrong direction? Thanks

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
JamieA
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.
May 14, 2012

This should give you a collection of ProjectComponent(s).

ComponentAccessor.getProjectComponentManager().findAllForProject(project.getId())

No idea about your other question, js sounds plausible.

Carl Nolan
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.
May 14, 2012

This looks promising. End of work day but I'll try it tomorrow. Thanks!

Carl Nolan
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.
May 15, 2012

Worked perfectly thanks

1 vote
Dieter
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.
May 14, 2012

Hi Carl,

Since at least 4.4 it's possible to get the project components from this resource

/project/{key}/components

but this is by project key only.

If you don't know the key you would have to enumerate all projects using the resource

/project

and search your id in the result object.

But as see from you subquestion that you want to display all projects in a first select box anyway, that seems ok to me. Maybe you can also reuse the project picker but this shows you only the projects you have access to


Carl Nolan
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.
May 14, 2012

Sorry should have mentioned the production environment is 4.1.2! Sorry my bad.

alexander schmack March 6, 2016

thanks a lot, easy to use and helped me out !

TAGS
AUG Leaders

Atlassian Community Events