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 votes

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,075 views 13 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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot