You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have sub-tasks in my jira instance to allow my customer to log more than one payment and avoid making multiple fields.
I am still learning scriptrunner and using the tutorial on the site create my first scripted field.
It works great until I get to the two customfields in my sub-task payment issue type: custom field payment because it is a numeric field and a single select list of payment sources. The output is this on my parent issue:
I am not sure what you are trying to achieve here, but the table with empty cells suggests your script is not presenting any data to go into the cells, probably because it is failing to read it (that's the usual culprit behind an empty result).
I can't really help without a better understanding of what you are trying to do (a statement like "add up some numbers on all the subtasks of an issue and show it on the parent issue" would be great ), or seeing what your script says at the moment.
Apologies for incomplete info and thank you for your help.
I created a sub-task that holds the payment in two custom fields: Payment Type and Payment Amount. The header in the table are the same of the fields. I don't know how to build the code to pull the data from those custom fields on the sub-task into the table on the "parent linked issue". So yes I want to pull the number fields that live only in that subtask into the table. (Let me know if I am unclear)
Thanks, I think that has cleared up all the bits I was not sure of!
So, this library entry is a little bit mis-named - it says "from JQL" but doesn't use any JQL for Server or DC, as it doesn't need to on them. https://library.adaptavist.com/entity/calculate-the-sum-of-fields-from-multiple-issues-from-a-jql-query
It is however, a script for a scripted field that reads a number from each sub-task, adds them together and puts the result out as the scripted field output.
It is not quite what you want, but it does show you how to grab numeric data from a set of subtasks