Hi there,
We recently updated to the latest version of JIRA and Script runner and are getting the following error on some post-functions script when creating subtasks.
The error reads: [Static type checking] - The variable [sourceIssue is undeclared . @ line 1, column 33.
We havent changed any of our code and were not getting this error previously. Should we be using something else instead of "sourceIssue"? Did you guys change something.
Condition Script:
'Email KWM' in cfValues['Content Items']*.value && !(issue.summary.contains("CLONE -"))
Additional Script:
issue.summary = 'CRF Email KWM - ' + sourceIssue.summary
Any help would be greatly appreciated.
Hi James,
It's hard to know the exact reason without knowing what version you updated from or to.
I've been having a look through though, and prior to 4.3.0 it may well have been sourceIssue. On all versions above and including 4.3.0 I believe the variable you are looking for is originalIssue.
The bind variables are all normally listed underneath the code window by clicking on the question mark symbol.
Does this answer your question?
Hey there,
Thanks so much for getting back to me! We upgraded Jira from v6.4 to v7.4.0 . We are running ScriptRunner 5.1.6.
I tried using originalIssue instead of sourceIssue as you suggested, it no longer gives me the following error:
The error reads: [Static type checking] - The variable [sourceIssue is undeclared . @ line 1, column 33.
However, when I try to create the subtask, it does fail to run.
sourceIssue does manage to create subtask and run properly, but throws the following error:
The error reads: [Static type checking] - The variable [sourceIssue is undeclared . @ line 1, column 33.
So not sure what is causing the error, even tho, the code works.
I tried looking for the question mark symbol for a list of bind variables, but don't see it.
Any help in resolving this would be greatly appreciated. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi James,
Apologies for the late reply. Just to clarify, from your previous message, everything works fine with sourceIssue, you just get a static type checking error?
If that is the case then you should be fine. The ScriptRunner documentation (https://scriptrunner.adaptavist.com/latest/jira/#_static_type_checking) states that the static type checker may not always be correct. It evaluates at run time and therefore might be missing sourceIssue when actually it is being added at a later time, before runtime.
You should safely be able to ignore this error ;-)
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.