Forums

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

Trying to create a sum field based on a lookup table and "for each smart value"

Joe Riley
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2025

I'm working on a jira automation flow. every time a value is added to the client field for a ticket, i want the 'Total revenue" number field to update on the ticket adding that client's revenue amount. The revenue amount per client is stored in a lookup table within the rule. I can get my logs to return the list of clients on the ticket, and their related revenue numbers. i can also get my total revenue number to update within the branch, but i can't get that to sum and update the jira field outside of the branch at the end. here's what I have that is the closest I've got:

 

When: Value changes for Client

Group 1:

Then:

  • Create Variable
    • variable name: totalRevenue
    • Smart value: 0

And:

  • Create lookup table
    • lookup table variable name: clientRevenueTable
    • Define table entries: Adams | 1000, Kids | 2500

(Branch)

  • For each: Smart value
    • Smart value: {{issue.Client.value}}
    • Variable name: eachClient
  • Then:
    • Create Variable
    • Variable name: clientRevenue
    • Smart value: {{clientRevenueTable.get(eachClient).asNumber}}
  • And: Create Variable
    • Variable name: totalRevenue
    • Smart value: {{#=}}{{totalRevenue}} + {{clientRevenue}}{{/}}

Outside of Branch:

  • Then: Edit work item field:
    • Total Revenue: {{totalRevenue}} 

 

I've also tried creating total revenue in the branch as {{totalRevenue.asNumber.plus(clientRevenue.asNumber)}} 

I've got logs at each of these steps that i didn't include for readability, but essentially they show:

  • Clients are consistently pulling into the rule
  • The lookup table is working (i.e. if the client is set to Adams and Kids i can return 1000 and 2500
  •  I have using the above been able to get it to set total revenue within the branch, but it won't update it outside of the branch

 

Image 8-13-25 at 9.48 AM.jpegImage 8-13-25 at 9.48 AM (1).jpegImage 8-13-25 at 9.49 AM.jpeg

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events