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,294,689
Community Members
 
Community Events
165
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
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

274 views 0 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you