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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,902
Community Members
 
Community Events
176
Community Groups

custom field display the numbers

Hi, 

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:

output of scripted field.png

2 answers

0 votes

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

Like Carla Ann Rowland likes this

I review the snippet--- I am still learning so add to this thread if I need more assistance. Thank you. 

0 votes

@Nic Brough -Adaptavist- 

Hi Nic, I need your experience and wisdom.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events