JIRA plugin REST: how to access?

rest-api

#1

I have next config (short version)

<?xml version="1.0" encoding="UTF-8"?>
<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" 
  <rest name="xObject" i18n-name-key="x-object.name" key="business-object" path="/xObject"
    version="1.0">
<description key="x-object.description">The xObject Smart Search REST Plugin</description>
  </rest>
</atlassian-plugin>

I tried to access

@Path("/xObject")
public class BusinessObject {
@GET
@AnonymousAllowed
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Response get(@QueryParam("searchKeys") String searchKeys) {//...

with

http://localhost:2990/jira/rest/xObject/1.0/xObject?searchKeys=X_

but got 404.

How to access it?
Or what could be in logs? See no errors.


#2

Hi @akharkovskij,

I tried your code and so far it works on my end. In your Jira instance, please go to REST API Browser, untick Show only public APIs and search for your REST API. You can also test it there and it will look like this

You can also see the full URL in the response should you wish to test it via CLI or via direct URL in a browser.

Is it safe to assume that you’re missing “>” only in the short version and not in your actual code?

Cheers,
Ian