Custome Field --> Script field ERROR



We have one scripted custome Field with name Total Find. It causing the error when we do any operation on issues. Like creating task, modifying and updating


Error message in logs

2015-10-29 14:37:14,985 http-bio-8443-exec-13 ERROR <JIRAUSER> 877x1208085x1 1wgnvp8 /secure/WorkflowUIDispatcher.jspa [onresolve.scriptrunner.customfield.GroovyCustomField] Script field failed on issue: TEST-60, field: Total Find

groovy.lang.MissingPropertyException: No such property: totalFind for class: Script6



Does any one has any clue on it?


Script we are using as follows

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
ComponentManager componentManager = ComponentManager.getInstance()
CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()
def issueLinkManager = componentManager.getIssueLinkManager()
def totalCollected = 0

if ( == "Task" ){ 
    def OutlinkedIssues = issueLinkManager.getOutwardLinks({ == "Findings"}*.destinationObject
    totalFind = OutlinkedIssues?.size()?:0
    def InlinkedIssues = issueLinkManager.getInwardLinks({ == "Findings"}*.destinationObject
    totalFind = totalFind + InlinkedIssues?.size()?:0
return totalFind ? totalFind as Double : null

2 answers

I think you intended to use the variable totalCollected, as you declared and initialized it before but never used. The code fails because in the return clause, you are doing an if and totalFind might not be even declared.



0 votes

Maybe you meant to use totalCollected instead of totalFind ?

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,175 views 13 19
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