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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
Community Groups

How can I refer values in multiple linked tickets at once and add them up?

I have a main ticket where an internal budget has been approved for X amount. Later, overtime, multiple tickets with invoices are linked to this main ticket. I'm then adding up the invoice values and comparing it to the main ticket's approved amount to identify when we are on budget.


However, as very often these invoice tickets are linked all at once, the automations do not run in succession and some invoice values are overriden and not accounted for. I want to run a scheduled automation that runs for each main ticket, goes through each invoice ticket and adds up the invoice amount of all and then stores it in the main ticket.


Main ticket

Invoice Ticket A (invoice amount: 25)

Invoice Ticket B (invoice amount: 17)

Invoice Ticket C (invoice amount: 8)


I want to run an automation that goes to the Main Ticket, then evaluates all linked tickets that meet a certain condition and then add up all the invoice amount and stores the result in the main ticket so that I get invoice amount: 50 in the Main Ticket.

2 answers

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 11, 2023

Hello @sergio_peschiera 

How many of these "main" tickets are there to evaluate?

You could run an Automation Rule with a Schedule trigger that use JQL to retrieve the main tickets.

When using a JQL in a scheduled trigger the actions after that in the rule will be executed for each issue returned by the JQL in the trigger.

Then use a Lookup Issues action to look up the linked issues. 

Follow that with an Edit Issue action to edit the Invoice Amount in the main ticket with the sum of the invoice amounts in the issues returned by the Lookup Issues Action:

{{lookupIssues.<your custom invoice field>.sum}}

Hey Trudy,

Gee, thanks! This could actually work! How do I use lookup issues to return the tickets linked to the trigger ticket? I don't think I've ever limited a lookup search based on the trigger ticket.

If I'm using the scheduled trigger, how do I refer to the "trigger" issue id? Would it be something like:

issue in linkedIssues({{issueid}})


I guess it would take the reference from the scheduled trigger but I'm not so sure.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 13, 2023

When using a Schedule trigger with a JQL statement to pick the primary issue, the rule will iterate over each issue in the result to execute the remaining actions in the rule. To refer to the issue in the current iteration use the smart value {{issue}}. You then can tack on to that smart value the field you want to reference and use that in the JQL.

So, in the Lookup Issues action you would use a JQL like this:

issue in linkedIssues({{issue.key}})

...if all the issues linked to the primary issue are Invoices. If they are not all invoices then you would have to add additional criteria to get only the linked Invoices.

awesome, this works perfectly. thanks again!

Like Trudy Claspill likes this
1 vote
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Apr 12, 2023

Hi @sergio_peschiera ,

I recommend you use the app developed by my team Cost Tracker for Jira Cloud.

Recently, we added an invoice generation feature to it.

In it, you can generate informative cost reports where everything will be calculated correctly.

Examples of reports:

4 (1).png


Suggest an answer

Log in or Sign up to answer
Site Admin
AUG Leaders

Atlassian Community Events