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

[Development] In Bamboo Plugin, how to consume REST API call for developed plugin Edited

I have developed a bamboo plugin, as per the tutorial i can access the rest url when using 

atlas-run
http://<host>:5990/refapp/rest/myrestresource/1.0/message

But now i have installed the plugin to my bamboo instance, how can i access the rest url of my plugin. i am tyring to access it using url as 

 

http://localhost:8085/bamboo/rest/myrestresource/1.0/message

not its showing me page not found error.

 

/**
* A resource of message.
*/
@Path("/message")
public class MyRestResource {

@GET
@AnonymousAllowed
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response getMessage()
{
return Response.ok(new MyRestResourceModel("Hello World")).build();
}
}

 

 

<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}"/>
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="RestAPI"/>
<!-- add our web resources -->
<web-resource key="RestAPI-resources" name="RestAPI Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="RestAPI.css" location="/css/RestAPI.css"/>
<resource type="download" name="RestAPI.js" location="/js/RestAPI.js"/>
<resource type="download" name="images/" location="/images"/>
<context>RestAPI</context>
</web-resource>
<rest name="My Rest Resource" i18n-name-key="my-rest-resource.name" key="my-rest-resource" path="/myrestresource" version="1.0">
<description key="my-rest-resource.description">The My Rest Resource Plugin</description>
</rest>
</atlassian-plugin>

1 answer

Hi @Muhammad Ramzan ,

Could you please confirm the plugin you have installed is enabled under Bamboo administration >> Manage Add-ons? If you open Bamboo logs (e.g <bamboo-home>/logs/atlassian-bamboo.log or <bamboo-install>/logs/catalina.out) search for your plugin groupId property described in pom.xml - check if there are any error(s) whilst loading the plugin.

Have you created your plugin using atlas-create-refapp-plugin or atlas-create-bamboo-plugin? Is it possible to mare your source code available on https://bitbucket.org or GitHub for review?

Looking forward to hearing back from you.

Kind regards,

Rafael

Thanks for your kind reply.

 

Yes , plugin is enabled on Bamboo , i verified and in logs everything is fine. 

 

I crated using " atlas-create-refapp-plugin", its working on JIRA and i can access the rest url in JIRA.

 

But in Bamboo i can't , i tried even using the Rest Browser plugin, but no url found.

Hi @Muhammad Ramzan ,

Thank you for your reply.

At this moment, it is difficult to troubleshoot this issue without looking at the source code, I am afraid. Based on what you have provided you should be able to access the endpoint mentioned, however, the 404 suggests the plugin is not working as expected. 

Please, have a look if all modules for your plugin are enabled - specially the one that relates to your rest api, e.g My Rest Resource. You can review this information from the same place mentioned previously - Bamboo administration >> Manage Add-ons - then search for your plugin and expand it to review its modules.

Kind regards,

Rafael

I even tried the default settings, once project was created by atlassian command i just installed the plugin with same settings as it is but no success 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

191 views 4 6
Read article

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