We require information from outside systems in our JIRA and Service Desk issues. The following script works fine:
import groovyx.net.http.HTTPBuilder
import static groovyx.net.http.ContentType.*
import groovyx.net.http.ContentType
import static groovyx.net.http.Method.*
import groovy.json.JsonSlurper
import net.sf.json.groovy.JsonSlurper
def http = new HTTPBuilder('http://example.com/api/product/' + getCustomFieldValue("Product ID"))
http.request(GET) {
requestContentType = ContentType.JSON
response.success = { res, JSON ->
return JSON.ProductWarrantyStatus
}
response.failure = { res ->
return "Error: ${res.status}"
}
}
However our needs from this system are growing and we need to make multiple requests this way; it is slowing each page load down noticeably, and each scripted field that I add slows it down even more.
How can I make these fields asynchronous, so that the requests load AFTER the JIRA issue details page loads?