Quantcast
Channel: Active questions tagged atlassian-plugin-sdk - Stack Overflow
Viewing all articles
Browse latest Browse all 280

Cannot create a fragment with a corresponding REST endpoint in Jira

$
0
0

I am trying to create a custom web item that navigates to a link when clicking on it. Here is a screenshot of the way in which I have created the custom web item: enter image description here

I have also defined a REST endpoint as you can see in the following screenshot 

enter image description here

Here is the corresponding code for my REST Endpoint that I have written in the script editor. The problem is that nothing works, even the string that I am writing to the log "THIS IS MOUNA'S TEST" is not displayed in the log. So when I click on the menu item "Mouna Bulk Summary", I get redirected to this error page. How can I fix this and make my fragment/REST endpoint work? enter image description here

import groovy.transform.BaseScriptimport com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegateimport javax.ws.rs.core.MultivaluedMapimport com.atlassian.jira.component.ComponentAccessorimport com.onresolve.scriptrunner.runner.ScriptRunnerImplimport com.atlassian.sal.api.ApplicationPropertiesimport com.atlassian.sal.api.UrlModeimport javax.ws.rs.core.Responseimport org.apache.log4j.Logger@BaseScript CustomEndpointDelegate delegate callFeaturePerformanceImpactAnalysis(httpMethod: "GET") { MultivaluedMap queryParams ->   def log = Logger.getLogger("atlassian-jira.log")   log.warn("THIS IS MOUNA'S TEST")   def user = ComponentAccessor.jiraAuthenticationContext?.loggedInUser   def issue = ComponentAccessor.getIssueManager().getIssueObject(queryParams.getFirst("issueId") as Long)   def baseUrl = ScriptRunnerImpl.getOsgiService(ApplicationProperties).getBaseUrl(UrlMode.ABSOLUTE)   def redirectUrl = "https://secapps.eur.ad.sag:9888/FPIA/?iTrac=${issue.key}&reporter=${user.key}&baseURL=${baseUrl}"   Response.temporaryRedirect(URI.create(redirectUrl)).build()}

Viewing all articles
Browse latest Browse all 280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>