It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

get response using scriptrunner Rest API request takes too long

As part of migrating my system to the cloud I have to modify my script.
nn my server I used   the function issueManager.getIssueObject("MyIssueKey")

In the cloud I am forced to use   Rest request

// Fetch the issue object from the key

def issue = get("/rest/api/2/issue/${issueKey}")

        .header('Content-Type', 'application/json')



When I rub this request for an issue the response time is 500ms and above
any way to speed it up ?

1 answer

Hi Jacob,

Thank you for your response.

I can confirm that the time it takes to return the results for your query depends on how long Atlassian take to return the data that is returned by your rest request. 

However, I can confirm if you only need some of the fields on the issue then you could look to only return the fields you need by specifying a queryStringParamater for just the fields that you require as described in the Rest API documentation page located here.

This would then reduce the amount of data that is returned and would help to speed up your request.

Finally, I can confirm that you can see more detailed information on the differences between the cloud and server versions inside of our documentation page located here.

If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.



Thank you Kristian for the prompt answer,


I have tried your suggestion using the following script:

import org.apache.log4j.Logger
import org.apache.log4j.Level

def log = Logger.getLogger("com.acme.CreateSubtask")
import groovy.json.JsonSlurper
// log.setLevel(Level.DEBUG)

def issueKey = 'BUG-139051' //This is for test in a console

// Fetch the issue object from the key
def issue = get("/rest/api/2/issue/${issueKey}?fields=customfield_10036,customfield_10025")
.header('Content-Type', 'application/json')

log.debug issue
return issue

as you may see  the duration is still high 677ms

Serializing object into 'interface java.util.Map'
GET /rest/api/2/issue/BUG-139051?fields=customfield_10036,customfield_10025 asObject Request Duration: 677ms
[expand:renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations, id:89034, self:, key:BUG-139051, fields:[customfield_10036:6428.0, customfield_10025:[self:, value:uStore, id:10103, child:[self:, value:uStore installers, id:10106]]]]

Hi Jacob,

Thank you for your response.

As mentioned previously the time that it takes to return the data is controlled by Atlassian and how long their systems take to respond to your request. 

I would advise contacting Atlassian direclty to ask them why the API is returning data slower than you expect. 



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Keep your team in the loop with Team @mentions in Jira Software!

Hi everyone! My name is Jenny, a Product Manager at Atlassian. After launching Team @mentions in Confluence, we heard a lot of positive feedback from customers that they love how easy it is to @men...

557 views 6 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you