Static Type Checking Error


When we upgrade Jira, groovy scripts which work successfully old version does not work anymore. In Jira script console, l got some static type checking errors errors.




1 answer

0 vote

Yes, the API often changes as versions change.

At a glance, there's nothing that jumps out as being wrong in your script, but I really can't bothered to read it properly without you saying which line might be a problem. I don't see any reason to put in any effort when the computer will tell us where it is faster.

Could you use the built-in script editor?  That will tell you where things are wrong in your script.

Yes, I use the built-in script editor. My scripts had no errors in my old version. My Jira is upgraded to 7.4.4. and all scripts gives static type checking errors. How can I fix all these errors? Is there any easy way to fix all of them at one-step correction?

No, you need to understand them to fix them.  A computer can't guess at what you were intending to do in your script.

However, static type checking is something that needs to be done when you use a weakly typed language like Groovy.  I personally dislike weakly typed languages because of this sort of woolly thinking they encourage, and I tend to fix most of the ones I cause by swapping to properly declared objects.  (instead of "def thing = ", I'll say "int thing = ", so I can rely on knowing what type of object "thing" is later)

There's a less opinionated write up about static object types over at which includes a lot of information on fixing them.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

795 views 2 19
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you