Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,299,994
Community Members
 
Community Events
165
Community Groups

Unsuccessful first step in a ScriptRunner workflow post function

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

0 votes
Hana Kučerová Community Leader Jan 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).

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

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

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    

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

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

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

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 

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

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

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

335 views 2 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you