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

0 votes
Accepted answer

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!

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
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,945 views 19 22
Read article

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