Hi,
I have created a behaviour (script "on website") to set/limit values based on an evaluation result of a helper class in another groovy script file. The behaviour imports that file/package and creates a new instance of that class.
Whenever I change something in the helper class, the UI/behaviour has the same result as before the change. If I add just a new line to the behaviour script, then it works as expected.
Is there maybe some caching involved? And if yes, how can I deactivate it, so that always the latest helper class is used?
I've been thinking this for quite some time, too. To me it definetly feels like there is some kind of caching involved but I don't have any proof nor confirmation from Adaptivist.
By the way, this also happens within Script Console and TestRunner. I usually work around it by slightly changing the method header (add/change a default parameter) every time I update a method. In Behaviour context, however, this doesn't seem to work and I need to disable and reenable the ScriptRunner plugin. This slows down development huge time and is really annoying.
For what it's worth, I'm still on ScriptRunner 6.6.0 (Jira Server 8.11) but according to the release notes, this shouldn't be the problem.
Did you come up with a better workaround or solution, yet?
@Jonathan Vahlsing , in Script Console I have also seen this weird behavior. :(
My workaround/solution was to put the whole behavior in a script file and set it up in the UI instead of writing the groovy on the website.
This solved for me the caching issue so far and we are at the latest ScriptRunner 6.11 and JIRA 8.5 LTS.
My findings so far, if everything is within files then it works. If it comes to a mix of script and files then the result may not be as expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You made my day!!
I keep all my scripts in files, too, and just link to them in the UI as you recommended. Still had the issues, though.
Then I saw I didn't enter the filename (foo/bar/MyClass.groovy) but package name and class (foo.bar.MyClass). Changed this and now it works like a charm.
Glad to hear you were able to fix your caching issues as well.
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.