I'm trying to create a rest endpoint (in ScriptRunner) which uses the mywork-confluence-host-plugin java api
Here's the code :
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.atlassian.mywork.host.service.LocalNotificationServiceImpl
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
@WithPlugin("com.atlassian.mywork.mywork-confluence-host-plugin")
@PluginModule LocalNotificationServiceImpl notificationService
@BaseScript CustomEndpointDelegate delegate
someEndpoint(httpMethod: "GET", groups: ["someGroup"]) { MultivaluedMap queryParams, String body ->
def notifications = notificationService.findAll("someUsername")
return Response.ok(new JsonBuilder(notifications).toString()).build();
}
However, when i include the @PluginModule annotation, the endpoint in ScriptRunner becomes invalid. When i try to hit the endpoint, I get a 404. In my configuration,
What a valid endpoint looks like in my configuration:
What the endpoint using @PluginModule looks like in my configuration:

