Hi ,
I am trying to add a Custom Web Item, i have added the button , but comment is not adding but flag is showing. How can i add Comment using REST Endpoint of Script Runner.
Please suggest.
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonOutput
import groovy.transform.BaseScript
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response
@BaseScript CustomEndpointDelegate delegate
approve(httpMethod: "GET") { MultivaluedMap queryParams ->
// the details of getting and modifying the current issue are ommitted for brevity
def issueId = queryParams.getFirst("issueId") as String // use the issueId to retrieve this issue
def flag = [
type : 'success',
title: "Issue approved",
close: 'auto',
body : "This issue "+issueId+" has been approved for release"
]
Response.ok(JsonOutput.toJson(flag)).build()
}