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

Simple JIRA DataCenter REST endpoint not working

$
0
0

I am trying to perform a REST endpoint with its corresponding web fragment but I am getting the error:

script function failed on issue: issue: SF-347, user: mouh, fieldId: __init__, file: <inline script>, edit behaviour: https://itrac-dev.eur.ad.sag/plugins/servlet/scriptrunner/admin/behaviours/edit/8, https://itrac-dev.eur.ad.sag/plugins/servlet/scriptrunner/admin/behaviours/edit/17, https://itrac-dev.eur.ad.sag/plugins/servlet/scriptrunner/admin/behaviours/edit/21Here is my error log here below:2022-08-16 20:39:37,512+0200 https-openssl-nio-443-exec-278 ERROR mouh 1239x60320x27 mu7qce 10.248.27.109 /rest/scriptrunner/behaviours/latest/validators.json [c.o.jira.behaviours.BehaviourManagerImpl] Script function failed on issue: issue: SF-347, user: mouh, fieldId: __init__, file: <inline script>, edit behaviour: https://itrac-dev.eur.ad.sag/plugins/servlet/scriptrunner/admin/behaviours/edit/8, https://itrac-dev.eur.ad.sag/plugins/servlet/scriptrunner/admin/behaviours/edit/17, https://itrac-dev.eur.ad.sag/plugins/servlet/scriptrunner/admin/behaviours/edit/212022-08-16 20:39:36,371+0200 https-openssl-nio-443-exec-278 WARN mouh 1239x60311x26 mu7qce 10.248.27.109 /browse/SF-347 [c.s.j.p.r.rest.api.MicroDashBoard] getiTracReleaseInfo for user "mouh" took 0 ms2022-08-16 20:39:36,371+0200 https-openssl-nio-443-exec-278 WARN mouh 1239x60311x26 mu7qce 10.248.27.109 /browse/SF-347 [c.s.j.p.r.rest.api.MicroDashBoard] getiTracReleaseInfo for user "mouh" - "green" -02022-08-16 20:39:36,371+0200 https-openssl-nio-443-exec-278 WARN mouh 1239x60311x26 mu7qce 10.248.27.109 /browse/SF-347 [c.s.j.p.r.rest.api.MicroDashBoard] getiTracReleaseInfo for user "mouh" took 0 ms2022-08-16 20:39:36,371+0200 https-openssl-nio-443-exec-278 WARN mouh 1239x60311x26 mu7qce 10.248.27.109 /browse/SF-347 [c.s.j.p.r.rest.api.MicroDashBoard] getiTracReleaseInfo for user "mouh" - "yellow" -02022-08-16 20:39:36,371+0200 https-openssl-nio-443-exec-278 WARN mouh 1239x60311x26 mu7qce 10.248.27.109 /browse/SF-347 [c.s.j.p.r.rest.api.MicroDashBoard] getiTracReleaseInfo for user "mouh" took 0 ms2022-08-16 20:39:36,371+0200 https-openssl-nio-443-exec-278 WARN mouh 1239x60311x26 mu7qce 10.248.27.109 /browse/SF-347 [c.s.j.p.r.rest.api.MicroDashBoard] getiTracReleaseInfo for user "mouh" - "red" -0

I don't understand why I have this error my code is super simple. Here is the way in which I have created my web fragment:

This is a screenshot of the custom web item fragment I have created:enter image description hereThis is the corresponding REST endpoint I have created:enter image description here

I am specifying the file MounaBulkSummary.groovy to be the one containing the code for the REST endpoint.

enter image description hereHere is the content of the file MounaBulkSummary.groovy

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.Loggerdef log = Logger.warn("atlassian-jira.log")    log.warn("MOUNA BULK")@BaseScript CustomEndpointDelegate delegateMounaBulkSummary(httpMethod: "GET") { MultivaluedMap queryParams ->    log.warn("MOUNA BULK")    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 282

Trending Articles



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