Support Required to send JSON.post from JIRA via scriptrunner

Hi Folks,
I’m a newbie here.

Hope you help:

My case: I want to create an annotation in Grafana when Jira issue was updated. So to solve this case - I try to send json.post via groovy language but still get errors on my Jira log:


ERROR /secure/AjaxIssueAction.jspa [c.o.scriptrunner.runner.AbstractScriptListener] Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file:
groovyx.net.http.HttpResponseException: Not Found
at groovyx.net.http.RESTClient.defaultFailureHandler(RESTClient.java:263)
at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:503)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:223)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515)
at groovyx.net.http.RESTClient.post(RESTClient.java:141)
at groovyx.net.http.RESTClient$post.call(Unknown Source)
at Script3362.run(Script3362.groovy:24)


Here is my code:


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.fields.CustomField
import groovyx.net.http.RESTClient
import groovyx.net.http.ContentType
import org.apache.log4j.Logger
import org.apache.log4j.Level
import com.atlassian.jira.issue.Issue
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
import groovyx.net.http.Method
import groovyx.net.http.HTTPBuilder
import groovyx.net.http.HttpResponseException
import groovyx.net.http.EncoderRegistry

def myIssue = event.issue
log.warn (key: myIssue)

def url = “http://grafana/
def client = new RESTClient(url)

def resp = client.post(

path: ‘grafana/api/dashboards/db/asd-health-monitor?orgId=1&panelId=24’,
headers: [‘Content-Type’:‘application/json; charset=UTF-8’,‘Accept’:‘application/json’,‘Authorization’:‘Bearer xKEYx’],
body: [‘text’:‘JRIA’],
requestContentType: ContentType.JSON
)
return resp
if (HttpResponseException) {
return (HttpResponseException)
}


Whats I doing wrong? Should I install some plugins into grafana or do something else…
Hope you help,