We have found this issue during indexing. It points to a custom field that uses the Groovy Runner. The field is scripted as follows
def templateType = getCustomFieldValue("Template Type").value;
def multiplier = (templateType == "NEQL"
? 500
: (templateType == "N+"
? 100
: 0));
def estimate = multiplier * issue.getOriginalEstimate() / 3600;
return String.format( '%,d', estimate as int);
This is the error generated by the reindex process. Any pointers?
2015-07-22 12:55:23,775 JiraTaskExectionThread-1 INFO chapmar 775x103x1 mmgxax 127.0.0.1 /secure/admin/IndexReIndex.jspa [jira.util.index.CompositeIndexLifecycleManager] Reindex All starting...
2015-07-22 12:55:23,823 JiraTaskExectionThread-1 INFO chapmar 775x103x1 mmgxax 127.0.0.1 /secure/admin/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 0% complete. Current index: Issue
2015-07-22 12:55:23,871 JiraTaskExectionThread-1 INFO chapmar 775x103x1 mmgxax 127.0.0.1 /secure/admin/IndexReIndex.jspa [jira.issue.index.DefaultIndexManager] Reindexing: {indexIssues=true, indexChangeHistory=true, indexComments=true, indexWorklogs=true}
2015-07-22 12:55:49,759 IssueIndexer:thread-2 INFO chapmar 775x103x1 mmgxax 127.0.0.1 /secure/admin/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 1% complete. Current index: Issue
2015-07-22 12:55:52,690 IssueIndexer:thread-8 ERROR chapmar 775x103x1 mmgxax 127.0.0.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] *************************************************************************************
2015-07-22 12:55:52,694 IssueIndexer:thread-8 ERROR chapmar 775x103x1 mmgxax 127.0.0.1 /secure/admin/IndexReIndex.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] Script field failed on issue: UDR-15, field: Estimated Cost
groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.Integer#multiply.
Cannot resolve which method to invoke for [null] due to overlapping prototypes between:
[class java.lang.Character]
[class java.lang.Number]
at Script2.run(Script2.groovy:8)
.....
2015-07-22 13:31:55,467 IssueIndexer:thread-10 INFO chapmar 775x103x1 mmgxax 127.0.0.1 /secure/admin/IndexReIndex.jspa [action.admin.index.IndexAdminImpl] Re-indexing is 98% complete. Current index: Issue
Regards,
Roy
I'd change line 8 (approx) to:
def estimate = multiplier * (issue.getOriginalEstimate() ?: 0 ) / 3600
Your problem is the overloaded operator "*" can be applied to either Characters, Numbers or Strings etc, so if issue.originalEstimate is null groovy doesn't know which to pick.
The pitfalls of dynamic typing...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.