Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements


  • Give kudos
  • My kudos


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira scriptrunner: Need to fetch value of scripted custom field

Dear Community

I have an Epic which has 2 stories. The story has a scripted numeric custom field named 'Delivery Estimate'. I want to get the sum of this field from stories to Epic. For this I have created a scripted field "Total Delivery Estimate", and I have written below code to fetch the values of Delivery Estimate at Epic level. The issue I see here is, jira script getcustomfieldvalue, does not fetch the value if custom field is 'scripted field'. Can anyone suggest if this is feasible and what would be the correct code. 


import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()
IssueLinkTypeManager issueLinkTypeManager = ComponentAccessor.getComponent(IssueLinkTypeManager)
IssueLinkManager issueLinkManager = ComponentAccessor.issueLinkManager

def value=0;

def linkType = issueLinkTypeManager.getIssueLinkTypes(false).find{ == 'Epic-Story Link' }
def issueLinkList = issueLinkManager.getOutwardLinks({ it.getLinkTypeId() == linkType.getId() }

for (issueLink in issueLinkList) {
def childIssue = issueLink.getDestinationObject()
def customField = customFieldManager.getCustomFieldObject('customfield_22601')

int currentValue= childIssue.getCustomFieldValue(customField)
value = value + currentValue
return value ;

1 answer

1 accepted

1 vote
Answer accepted

Hi @Parvez Misarwala 
I had a similar problem.
My workaround was to save that scripted field into another custom field . 
That way I can fetch from the "normal" custom field instead of the scripted field.

Code inside your story scripted field:
calculate the value to return , lets call it X 
save X inside your "normal" custom field 
return X 

Thats perfect..Thanks a lot @Gustavo Félix 

Like Gustavo Félix likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,595 views 22 33
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you