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

Summing values from a custom fields in a task into a custom field an Epic (JWM)

shelleyc January 27, 2023

I am trying to create an automation in a Jira Work Management Project that will add the value from the custom field in a task called "Invoiced Amount" which is "customfield_10156" and add to the custom field in the Epic called "Total Payments Received for FY" which is "customfield_10158" when the Task is transitioned from "Invoiced" (In Progress) to "Payment Received" (Done). 

I was able to get the basic automation done but have had zero luck in getting it to sum the Invoiced Amount to the Total Payments received. My research tells me that you cannot sum custom fields like this via JQL and I am not familiar with Json and am basically stuck. I have done some research and believe that I need to send a Web Request, but could really use some help. 

I am also having trouble getting it to select the issues in the Look Up without explicitly stating the parent ID. I figured that would be relatively easy once I figured out the summing part, but suggestions are welcome. 

Also, I don't have a preference if it adds the invoiced amount of the card being transitioned to the Total or if it just takes all of the cards in the Invoiced Paid column related to the parent and sums them all up and overwrites the existing total. 

 

Jira_help1.jpg

 

Thanks in advance!

Shelley

 

1 answer

1 accepted

2 votes
Answer accepted
Bill Sheboy
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.
January 27, 2023

Hi @shelleyc -- Welcome to the Atlassian Community!

In your lookup issues JQL that is inside of the branch, you may refer to parent = {{issue.key}} rather than the literal value.  Inside of a branch, {{issue}} refers to the branched-to issue(s).

What is the purpose of your webrequest in the rule?  If you just need the sum from the lookup you could do that with

{{lookupIssues.your field.sum|0}}

Kind regards,
Bill

shelleyc January 27, 2023

I have tried every combination of {{lookupIssues.Invoiced Amount.sum|0}} and {{lookupIssues.customfield_10156".sum|0}} and neither of them have worked. It is like it is not recognizing that field at all. 

Bill Sheboy
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.
January 27, 2023

Smart values for fields are name, spacing, and case sensitive, so a small typo could lead to null results, and no error.

Let's try this: find an example issue with your field and then use this how-to article to confirm the exact name of your smart value.  And...if you do not see the field, that tells you it is not supported by automation rule usage of the REST API.  https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Also...would you please show images of the details of your edit issue action and of the audit log details from the rule execution?  Thanks!

Like Steffen Opel _Utoolity_ likes this
shelleyc January 30, 2023

I was finally able to get the correct combination! See my solution below:

working_automation.jpg

My Edit Issue formula is: {{lookupIssues.customfield_10156.sum|0}}.

 

Thank you for the help! This will make a huge difference in keeping track of invoices for a project I am managing.

Like # people like this
wstromm
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!
April 21, 2024

Hi, i can not get i work on datacenter. Is your automation running on cloud or datacenter version?

Thank you.

Bill Sheboy
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.
April 21, 2024

Hi @wstromm -- Welcome to the Atlassian Community!

For Jira Data Center's version of automation, custom fields and many other fields are not yet supported for the Lookup Issues action.  Please watch / vote for this suggestion to see progress on adding them: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877

There are two possible workarounds, depending upon what you need to do:

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events