Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Custom Endpoint help for JIRA API


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


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()

1 answer

0 votes
Ken McClean
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 09, 2023

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.

Full credit as always to @Peter-Dave Sheehan for writing the original post that helped me figure it out.

Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 09, 2023

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:

Like Ken McClean likes this

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events