Forums

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

Issue screen reporting

Jon
Contributor
July 16, 2018

Hi,

i was wondering how i could add total on the issues screen. For example on my issue screen i have a field called quantity. how could i add i sum total to this field that would be viewable on this screen? 

 

jon 

1 answer

0 votes
Nic Brough -Adaptavist-
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 Leaders.
July 17, 2018

You'll need some code to work it out for you and put it in a field.

However, fields belong to the current issue, so a big question is what are you trying to add up?

Jon
Contributor
July 18, 2018

The field is for quantity of contracts. WE have many contracts so many figures to add up. Im often using filters to refine the list but need to know the total after the appropriate filters are in place. 

 

How difficult is the code work? Too much for a novice? 

Thanks

Nic Brough -Adaptavist-
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 Leaders.
July 19, 2018

It's rarely too difficult for a novice!  Most of us use scripting add-ons that strip away the need for full-blown development.

It's clear what you want to add up, but my question was more aimed at thinking about where you want to do this.

An issue is a representation of something that needs attention for some reason.  It's made up of fields that directly relate to that issue.  If you have a field called "quantity" on an issue, then that probably gives you a numerical quantity of <somethings> for that issue, which is fine.

But you're asking to add up some values.  My question is what, and where should it go? 

Imagine I'm using Jira for billing something.  Every issue has a "cost".  It's perfectly reasonable to want to add up a list of costs, but, where?  If an issue has sub-tasks, then representing the sum of costs on the subtasks on their parent is usually very useful, but I'm not sure that is what you mean here?

Jon
Contributor
July 19, 2018

 Thanks for all this. I would want this new field quantity delivered on the contract  screen. The way I have set things up is that I have two separate types of issues, one called  contracts which includes the quantity that has been sold and the other is quantity delivered. The quantity delivered per each issue varies as well as the contract size so the number of issues that need to be applied to satisfy a contract very greatly. I’ve been linking the quantity delivered issues to the appropriate contract however the only thing that shows up on this screen Is the reference number to the link issue so it takes much too long to add up everything.

Nic Brough -Adaptavist-
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 Leaders.
July 19, 2018

Ok, that sounds similar to my sub-task example I think.  To confirm, I'll paraphrase a spec back to you:

  • You've got a "Contract" issue type.
  • You've got a "Delivery" issue type, which has a quantity field on it
  • You routinely link many "Delivery" issues to a "Contract"
  • You need to add up the quantities on the linked "Delivery" issues
  • (I am sure there are more nuances here, such as "only count a quantity if a Delivery issue has gone to or past the status "Delivered", and "only look at certain types of link", but we're just looking at the basic principles at this point)

If that is correct, then there's a couple of things I would look into.

  • It is possible to hack the links section so that it shows more than just the summary, key and status of linked issues.  It is a code change, but it's not a painful one.
  • If you have one of the scripting or automation add-ons, you could write a field that appears on Contracts, exactly as you first suggested.  I'd do it with a scripted field from ScriptRunner (because I'm familiar with it) - it would be able to read the list of links, select the ones it needs, and add up.  You'd also need listeners to catch changes to links and the quantities to trigger it to recalculate the Contract when they happen.
Jon
Contributor
July 19, 2018

is this hack available for jira cloud? id be happy to get script runner if it would work in cloud. i would need guidance to set up a listener. 

 

thanks for the help,. 

Nic Brough -Adaptavist-
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 Leaders.
July 19, 2018

I'm afraid not, it's in the deployed system (I almost said "code" there - it's not quite code), which you can't change on Cloud.

ScriptRunner does work in Cloud, with some limitations imposed by the platform (for example, Cloud can't yet support conditions or validators)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events