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
I wrote a little bit on accessing REST resources using ScriptRunner for both Jira Server and Jira Cloud. Maybe something in there could be of use to you.
https://www.kennethmcclean.com/blog/scriptrunner-foundations-accessing-jira-rest-api-using-groovy/
Full credit as always to @Peter-Dave Sheehan for writing the original post that helped me figure it out.
Getting name-dropped in a blog! Am I a celebrity now?
You might appreciate simplifying this even more by encapsulating what you call the "framework" in a simple class.
Then you can just call it like this:
import jiraserver.scriptrunner.utils.SRRestUtil
def srRestUtil = new SRRestUtil()
srRestUtil.makeRequest('GET', srRestUtil.baseUrl + '/rest/api/<version>/<endpoint>', [mapKey:mapValue])
I've shared my version of such a class here: https://bitbucket.org/peter_dave_sheehan/groovy/src/master/jiraserver/scriptrunner/utils/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.