I need to make Jira Rest API from Bamboo. So I am trying to write a plugin.
I found in this forum that I should use jiraRestService.
I am trying to do something like
JiraRestResponse response = jiraRestService.doRestCallViaApplink(applicationLink, "rest/api/latest/search/?jql=status = A-New ", MethodType.GET, null);
I successfully got the ApplicationLink with the JiraApplinksService injected by Spring method.
But I cannot figure out how to use the jiraRestService. Spring looks to not inject it.
Can you please help me.
I think you need to downgrade your plugin version to 1. Apparently the JiraRestService is not available for plugins of type 2. Do you know what are the differences in bamboo plugin version 1/2?
To change your plugin to version 1 you need to update the atlassian-plugin.xml (AFAIK in the first line there is version declaration). But be aware that for developing version 1 plugin you will need probably to restart your Bamboo instance (atlas-debug, ctrl-c, atlas-debug, ctrl-c, etc) whenever you make changes in your plugin.
That should do the trick and let the JiraRestService to be auto injected by Spring.
It is a new plugin so I have no problem to move it to version 1.
I do not know what is the difference between the 2 versions.
I will try and gives you the feedback.
But a more general question, where can I find a exhaustive list of what can be auto injected by Spring. I try to find this information on your web site without sucess.
Generally, the most important difference (IMO) is that plugin of version 2 can be hot-swapped on a running instance, whether to install/upgrade plugin 1 one would have to take his/her Bamboo instance down, install plugin, restart Bamboo.
As to where is the list of auto-injected components - I don't know, I think we do not publish that (but I'd seek that information on http://docs.atlassian.com). BTW: do you have access to the Bamboo source code?
It is working with version 1 plugin :-)
The only problem with version 1 is that I have to fully restart bamboo to make my tests, not so efficent for debuging.
Is it plan to add Jira rest service in plugin version 2?
What do you mean by "do you have access to the Bamboo source code?"
The sources of Bamboo code are distributed with the more expensive licenses. I don't recall which exactly, but the cheapest one (Starter) definitely doesn't have them. If you would have Bamboo src distribution I could point you more-less to a files definining which Spring components are auto-injected to plugins 2, and which don't.
As for adding JiraRestService to plugins 2 -> I'll check that tomorrow with Bamboo team, OK?
Thank you for the information. I changed to version 1 plugin type and I sucessfully call a Jira rest request from my Bamboo plugin :-)
I still did not buy Bamboo I am still evaluating. But as I suceesd to make what I need I will now buy it. Please tell me where I can find the Spring configuration in Bamboo source and I will see if I can see it.
To check which components are available to the plugins (ver 2) I'd check all applicationContext*.xml files in your BAMBOO/webapp/WEB-INF/classes directory (if you don't have it there, just scan your Bamboo or Bamboo-sources for application*.xml files) - and browse the contents scanning for any bean that have plugin:available="true" attribute. That beans are injected on the plugins ver2.
Does my answer helps you, or were you asking about something different?
To my understanding the JiraRestService is indeed available for plugins of version 2 in Bamboo 5.0. I might be wrong as I didn't test that manually, but that's what I see in the 5.0 source dode - the JiraRestService is annotated as being exported for plugins 2.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events