So, as the Adaptavist docos say
REST API calls are made in a blocking style (although async methods are provided too)
Async methods look to be useful when you need to fire a bunch of updates to JIRA and don't care about the results from each. Question is; how many threads does each container get access to and what happens when that count is exceeded.
As an example; if I try something like
import com.mashape.unirest.http.async.Callback
import com.mashape.unirest.http.exceptions.UnirestException
def issueCount = 100
for (int i=1; i<issueCount; i++) {
put("/rest/api/2/issue/PROJ-${i}")
.header('Content-Type', 'application/json')
.body([
fields:[
summary: "This is issue ${i}"
]
]).asStringAsync(new Callback<String>() {
public void failed(UnirestException e) {
logger.info("Exception failure ${e.toString()}")
}
public void completed(HttpResponse<String> response) {
logger.info("Responses are pointless here!")
}
public void cancelled() {
logger.info("The request has been cancelled");
}
})
}How will this break? Also I have not tested this code beyond a simple example; no guarantees this will even run.
Edit: more code typos