Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unsuccessful first step in a ScriptRunner workflow post function

Team 4all January 20, 2021

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?

 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2021

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).

Georges Cuny January 21, 2021

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

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 21, 2021

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

Georges Cuny January 21, 2021

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    

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 21, 2021

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

Georges Cuny January 21, 2021

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

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 22, 2021

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

Like Hana Kučerová likes this
Team 4all January 24, 2021

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 

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2021

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

Team 4all January 25, 2021

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

StaticTypeCheckingErrors.jpg

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2021

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

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events