Hi,
I am currently stuck with a problem regarding the ScriptRunner REST endpoint Response.
I have a script that if finished correctly should send a notification response to the user.
This works as expected, if the time required for the script to run is about 5 seconds.
Due to some reasons the script can take up to several minutes to run.
If it does, then the UI does not show the Response of the Script REST endpoint.
The Response is defined like the following:
def flag = [
type : 'success',
title: "S3 REST endpoint",
close: 'manual',
body : "Test"
]
Response.ok(JsonOutput.toJson(flag)).build()
To analyse the problem with the script running longer I checked the logs by putting
log.warn(flag)
before the Response. It shows the flag correctly but the response is not visible in the UI.
Is there some sort of Jira limitation I am not aware of?
Best regards
Fabian
Flags are not well suited for long-running tasks. Your browser will give up before you get a response default browser timeout).
Ideally, some sort of UI that provides a progress bar would be best. But that' not something that's available from scriptrunner.
What you might do is send the processing of your long-running task into a separate thread and return a flag that says "task is started". And perhaps provide some other ways to alert the users when it is finished (maybe via email notification).
Thank you for the detailed explanation.
I will try to use a combination of issue properties and separate threads.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.