HI, This is my first time creating a custom rest endpoint. I tried to research but I can't find any. So basically i jsut want to call a jira api and display the output. Below is the code
getWorkflowNames(
httpMethod: "GET", groups: ["jira-users"]
) { MultivaluedMap queryParams, String body, HttpServletRequest request ->
def extraPath = getAdditionalPath(request)
if (extraPath == "" || extraPath == "/") {
return Response.ok(new JsonBuilder(["Enter a project key. Ex: " +jiraurl+ "/rest/scriptrunner/latest/custom/getWorkflowNames/PROJ"]).toString()).build()
} else {
def projectKey = extraPath.split('/')[1]
def String ProjKey = queryParams[projectKey];
return Response.ok(new JsonBuilder(['I need to get the output of this line but how? : ' +jiraurl+'/rest/api/latest/project/'+projectKey+'/workflowscheme']).toString()).build()
}
}
I'm trying to look for something like
return(new URI (jiraurl+'/rest/api/latest/project/'+projectKey+'/workflowscheme')).build()