You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.