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

Call Jira rest API from Bamboo plugin

Yann Augustin February 10, 2013

Hello,

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.

Best regards

Augustin Yann

7 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
PiotrA
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.
February 10, 2013

Hello Yann,

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.

regards,

Yann Augustin February 10, 2013

Hello again,

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.

Best regards

Yann

PiotrA
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.
February 10, 2013

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?

Yann Augustin February 10, 2013

Hello,

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?"

Best regards

Yann

PiotrA
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.
February 10, 2013

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?

Yann Augustin February 11, 2013

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.

Best regards

Yann

PiotrA
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.
February 11, 2013

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?

regards,

Yann Augustin February 11, 2013

Thank you for all theses informations.

I got all I need.

Best regards

Yann

0 votes
Augustin Yann July 17, 2013

Hello,

I upgraded my plugin to version 2 and it is still working with Bamboo 5 :-)

Thank you for your help.

Yann

0 votes
PiotrA
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.
July 17, 2013

Hello Yann.

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.

regards,

0 votes
Yann Augustin July 16, 2013

Hello,

We are now upgrading to the versin 5 of Bamboo.

Can this version now inject JiraRestService with version 2 plugin?

This will help a lot as version 1 plugin is more complex to upgrade than the version 2.

Best regards

Augustin Yann

0 votes
Yann Augustin July 16, 2013

Hello,

We are now upgrading to the versin 5 of Bamboo.

Can this version now inject JiraRestService with version 2 plugin?

This will help a lot as version 1 plugin is more complex to upgrade than the version 2.

Best regards

Augustin Yann

0 votes
Yann Augustin February 10, 2013

Hello,

Version is 4.2.2 build 3213

0 votes
PiotrA
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.
February 10, 2013

Hello Yann,

just a quick question: which exact Bamboo version are you writing your plugin against?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events