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

Fesifaz Ino April 17, 2013

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

0 votes
Answer accepted
Fesifaz Ino April 19, 2013

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 votes
Jeff Putsch May 7, 2013

Fesifaz,

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

Thanks,

Jeff.

Fesifaz Ino May 13, 2013

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.

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2013

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?

Fesifaz Ino April 19, 2013

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!

Suggest an answer

Log in or Sign up to answer