Hi all,
my first two lines
def issueKey = issue.key
logger.info "issueKey" + issueKey
in the additional code area of a workflow post function show a
[Static type checking] - The variable [issue] is undeclared.
@line 1, column 16
What is wrong or missing with this code?
Hi @Team 4all ,
I would recommend you to try some provided example like "create comment". If it is a post function, issue should be available and the script will work (even if you get this check error).
Hi @Hana Kučerová ,
thank you very much for your response. Indeed, the scripts do work in spite of the misleading check errors.
Best regards, Georges
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Team 4all and Georges,
I can confirm that these errors are static type check warnings as described in the documentation page here and these occur when the compiler does not fully understand the code but these will not the scripts from running.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kristian Walker _Adaptavist_ ,
thank you for your input. Nevertheless I think that 'issue', as it doesn't need any declaration, should be well known so that the corresponding static errors could be hidden. Showing errors where there is no error is really very misleading and I am used to not check in code showing errors. I reference the issue object in many lines and the amount of shown insignificant errors makes it difficult to focus on real errors.
Best regards, Georges
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Georges,
I can confirm that I have raised your request with my colleagues in the development team at Adaptavist and they are going to look into this warning and see if it can be resolved.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kristian,
great! Thank you very much.
The mentioned error took me several hours of investigation and research ...
... and caused a lot of frustration as the examples Atlassian provides show the very same error as well.
Best regards, Georges
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Georges,
I just wanted to follow up and let you know that our developers have deployed some changes now which should restore the issue binding and resolve these static type checking errors.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kristian,
thank you very much. I'm sorry, but these static type checking errors are still present in the editor window of workflow post functions.
Do apps in the cloud have a release number? Where can I see the release number for ScriptRunner and what's the number of the release with the named solution?
Best regards,
Georges
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Team4All,
I can confirm in the cloud we do not have a release number.
Can you please share a screenshot showing what static type checking warnings you are still receiving?
As mentioned previously, there will always be some static type checking errors where the compiler cannot fully understand the code, and these are explained in the doc
The static type checking warnings are not errors as you have mentioned, and are simply just warnings which can be ignored as if you test and run the code then it should run as expected.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kristian,
you are right; warnings are no errors (but not the less misleading). I agree, I hadn't seen, that the red underline has disappeared. Please find the requested screen shot in attachment.
Best regards,
Georges
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Georges,
I can confirm that thee warnings are just static type checking warnings as described here now that the bindings have been restored.
As mentioned in this page the warnings can never be fully removed due to the way which Groovy works in a language and with these warnings, I would always recommend testing the script as these will not stop the script from working as expected.
Regards,
Kristian
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.