Script Runner adds additional IssueFunction custom field every time I restart Jira

Every time I start Jira, the Script Runner plugin adds another IssueFunction custom field to it. I’ve now got over a dozen identical IssueFunction fields.

What could be causing this?

This is with Script Runner 2.1.3 and Jira 5.1, if it matters.

3 answers

1 accepted

Actually, it appears that it is one our one organization’s customizations to Jira that is messing things up. Script Runner’s problems were likely just a symptom of other problems. Sorry to have troubled everyone!

0 vote

Weird... can you do

select * from customfield where cfname = 'issueFunction'

and check the customfieldtypekey - it should be 'com.onresolve.jira.groovy.groovyrunner:jqlFunctionsCustomFieldType'. Is it?

Thanks for trying to help, Jamie! The custom field type key is indeed 'com.onresolve.jira.groovy.groovyrunner:jqlFunctionsCustomFieldType'. But, as I say in my answer, it looks like your Script Runner plugin is blameless, and this is our organization’s doing. But thank you again for your efforts, and sorry for troubling you!

Fesifaz,

We see similar behavior. What customization did you have that caused this behavior?

Thanks,

Jeff.

One the plugins we wrote tried, in its constructor, to access a custom field implemented by another plugin.

The code looked something like this:

public ProprietaryListenerClass(CustomFieldManager customFieldManager) {
    this.customFieldManager = customFieldManager;
    this.proprietaryCustomFieldObject = customFieldManager.getCustomFieldObject(33333L);
}

This caused problems when Jira started up, because at the time the ProprietaryListenerClass in constructed, the plugin implementing the accessed custom field might not be loaded. In turn, this caused other problems, such as some of our custom fields not starting up properly. Script Runner must have gotten a failure trying to access the issueFunction custom field when it started up, which fooled it into thinking it didn’t exist, and so created another one. Then the Jira administrator would see these problems on startup and manually fix them (although not the underlying problem, buried in the code). When the dust settled, we had one more issueFunction field than we had before.

After I moved the call to getCustomFieldObject out of the constructor, everything works fine.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

102 views 0 2
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