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
Community moderators have prevented the ability to post new answers.
This should give you a collection of ProjectComponent(s).
ComponentAccessor.getProjectComponentManager().findAllForProject(project.getId())
No idea about your other question, js sounds plausible.
This looks promising. End of work day but I'll try it tomorrow. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Worked perfectly thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry should have mentioned the production environment is 4.1.2! Sorry my bad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.