The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate value from other fields through script runner plugin.

Subhash Haritwal
August 1, 2018

Hi,

i have two different custom fields for ex. 1) - Business Value 2) - Technical Value

i want to get sum value of above both fields into "Overall Value" field.

i created Scripted Field which name is "Overall Value".

which script i have to put in Description and how to add post function?

Please help me, i am new on this and it's priority task for me .

 

Regards,

Subhash

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Mark Markov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 1, 2018

Hello @Subhash Haritwal

Place this script in your scripted field

import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def businessValue = issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectByName("Business Value"))
def technicalValue = issue.getCustomFieldValue(customFieldManager.getCustomFieldObjectByName("Technical Value"))

return businessValue + technicalValue

For what purposes do you need postfunction here?

TAGS
AUG Leaders

Atlassian Community Events