I have asked this question in Script Runner support, so I realley appreciate any help that somebody can gives me:
I have implemented a behaviour initialiser function script which makes a REST API call.
The behavoiur script is executed one, two, three or four times (this behavoiur was reported https://productsupport.adaptavist.com/servicedesk/customer/portal/2/SRJSUP-2729) and I want to log how many times the REST API is called, filtering calls for example with Chrome debug tool or with some protocol analyzer like Wireshark, but I don't know how to filter the API REST calls because are wrapped into the script.
The REST API call is made like this:
Map getInstallInfo(OkHttpClient httpClient) {
String url = 'http://192.168.5.227:51681/GeneralService.svc/GetClientProductList' String projectName = getIssueContext().getProjectObject().getName()
RequestBody body = RequestBody.create(MediaType.parse("text/plain"), JsonOutput.toJson([Product: projectName, Client: null]))
Response response
try {
Request request = new Request.Builder()
.url(url)
.post(body)
.build()
response = httpClient.newCall(request).execute()
return response.isSuccessful() ? [contentText: response.body().string()] : [errorText: "${response.code()} - ${response.message()}"]
} catch (e) {
return [errorText: "${e.class.canonicalName} - ${e.message}"]
} finally {
response?.close()
}
} Therefore, I want to know how many times this URL (http://192.168.5.227:51681/GeneralService.svc/GetClientProductList) is called.
I really appreciate yout help.
Thank you in advanve.
Regards,
Miguel.