Jira gadget plugin fails when calling a REST endpoint. Alerts in my XML don’t fire, and errors appear. Revised examples below indicate a new gadget configuration and Java service.
<gadgetConfig>
<resources>
<script src="/api/js/custom-script.js"/>
</resources>
<entry>
<onLoad>startGadget</onLoad>
</entry>
</gadgetConfig>
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
@Path("/Feedback")
public class FeedbackService {
@GET
@Path("/ping")
public Response ping() {
return Response.ok("Hello from Java REST", "text/html").build();
}
}
Based on my experience with similar setups, I found that the problem was often not with the code itself but with the configuration settings of the plugin. I had encountered an issue where my REST calls would silently fail, and after a thorough review of the server logs, I noticed that the error was caused by an out-of-date dependency which led to compatibility issues. Adjusting the library versions and verifying the plugin classpaths in the build configuration resolved the problem. It might be useful to check the server logs in detail and confirm that the resources referenced in the XML are accessible.
I encountered a similar issue where the REST endpoint did not respond as expected. In my case, the problem was related to an incomplete URL mapping that interfered with the gadget’s load process. After carefully revising the web.xml configurations and ensuring that the service path was properly registered, the call started working. Additional logging on the endpoint clarified the expected behavior and helped identify any discrepancies between the service’s declarations and the gadget’s resource path. Therefore, reviewing the entire configuration for both the plugin and the REST service could lead to a resolution.