Custom Script Field to sum value those results in billion

Amit Kumar Singh March 7, 2022

What should is use in place of double to calculate the value in billion.

Custom Script Field.PNG

import com.atlassian.jira.component.ComponentAccessor

import com.atlassian.jira.issue.history.ChangeItemBean

 

// Get values from 4 custom fields

Double val1 = makeNullZero(getCustomFieldValue('Field Name ($)'));

Double val1 = makeNullZero(getCustomFieldValue('Field Name ($)'));

Double val1 = makeNullZero(getCustomFieldValue('Field Name ($)'));

Double val1 = makeNullZero(getCustomFieldValue('Field Name ($)'));

Double sum = val1 + val2 + val3 + val4;

1 answer

1 accepted

0 votes
Answer accepted
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2022

Hi @Amit Kumar Singh 

Can you try Biginteger or long

Amit Kumar Singh March 8, 2022

Hi @Mohamed Benziane 

I tried long and it is working fine for me.. Thank You So Much!

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 9, 2022

hi @Amit Kumar Singh 

feel free to accept the answer to mark your question as solved

Amit Kumar Singh June 7, 2022

Hi @Mohamed Benziane 

Need one more help on this as when i apply filter search, it shows below error.

 

image.png

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 9, 2022

It seems that your field "Total Annual" is a text customfield so you can't use the operator here

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events