Script Runner Error 'Failed type checking'

I am trying to use script runner to be able to check my scripts for any error/deprecated classes. However for two files simply says that there was an error:

Failed type checking and we don't know why, it's our fault not yours @ line 1, column 1.

 

Is there any possible reason why the it is doing this. I know for a fact there should be some errors indicating deprecated classes since there are a few calls to component manager in there.

UPDATE: Found the following piece of code that is causing the error

Map tmprc = issue.getCustomFieldValue(rcObj) as Map
 if (tmprc) {
 // Root Cause Category field defined but ensure both parts of its cascading field are selected
 rotCausEntered = ((tmprc.get(null) != null) && (tmprc.get("1") != null))
 }

//in particular is is the following bit of code causing the error

(tmprc.get(null) != null)

2 answers

It's the it that's causing this, you say? As in the it variable that exists inside of a Groovy closure?

That's one of the known limitations of the static type checker. The types of Closure parameters cannot be inferred.

See https://scriptrunner.adaptavist.com/latest/jira/#_static_type_checking.

They can be inferred usually, eg in 

issue.subtasks.collect {it.summary }

but not in 

def c = { it.summary }
issue.subtasks.collect(c)
0 vote

When you say "assembled using make" what does that mean? Can you slim it down to a representative sample?

 

 

Added a representative sample.

 

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

539 views 1 18
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