Forums

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

Sum of a custom field value to another custom field

Swapnil Tiwari
August 28, 2017

Can you please help me with script of the below use-case –  

For a sub-story which is linked to a story.

I want to calculate the sum of the values of a custom field (Technical Points) belonging to issuetype – Sub-story. Further, I want that value to be placed in another custom field (Aggregate Technical Points) belonging to a custom issuetype - story. Attached screenshots display different

Attached screenshots display different issuetypes (Story and Sub-story) that we are using, just to avoid confusions.

Please help me with the script of the above use-case.Screen Shot 08-22-17 at 05.48 PM.PNG

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
PD Sheehan
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.
March 24, 2023

There is no reason for a for-loop to break anything. 

But how does the for-loop break your behaviour?

What errors are you getting?

What gets outputted to your log?

Bellina Bui
March 27, 2023

Hi Peter just validated that in fact you can use for loops in behaviors! 

 

When I was trying to grab the product line field I wasn't referencing the originated issue, but rather the destination issue. Corrected the below:

def productLineValue = contextIssue.getCustomFieldValue("Product Line(s)") as List
TAGS
AUG Leaders

Atlassian Community Events