Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Call Jira rest API from Bamboo plugin

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

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,

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

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?

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

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.

Best regards

Yann

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,

Thank you for all theses informations.

I got all I need.

Best regards

Yann

Hello Yann,

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

Hello,

Version is 4.2.2 build 3213

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

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

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,

Hello,

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

Thank you for your help.

Yann

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS

Community Events

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

Events near you