Sum custom field in Task and Story

Ismael November 5, 2024

Hi,

 

We need to create a rule 

I need to create a rule that is capable of adding a faithful custom called Story Point (Portfolio) of all the tasks of the Story and Task type, and the sum is displayed in a field called Current Story Point, located in the Epic.

1.png2.PNG3.PNG

 

6 answers

2 votes
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.
November 26, 2024

@Ismael please see my post above ^^^^

To update the parent issue with the sum of a custom field, you would need to gather the issues using the REST API, called from the Send Web Request action.

 

Here is a how-to article for calling the REST API from a rule: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

I believe this is the REST API endpoint you need: https://docs.atlassian.com/software/jira/docs/api/REST/9.13.0/#api/2/search-search

Finally, you may need to use the custom field id rather than the field name.  This how to article will help identify that value for your field: https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html

 

2 votes
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.
November 6, 2024

Hi @Ismael -- Welcome to the Atlassian Community!

Adding to Trudy's answer...

If you want to sum a custom field and save the result in another issue, you cannot use the Lookup Issues action; that action does not support custom fields for the Data Center version of automation rules yet: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877

The possible workarounds depend upon your rule structure, and you likely would need to call the REST API issue search with JQL, using the Send Web Request action, and then sum the field from the web response.

Kind regards,
Bill

1 vote
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.
November 5, 2024

Hello @Ismael 

Welcome to the Atlassian community.

Is that the entirety of your rule; 3 components?

If so, one problem is that the {{lookupIssues}} list is only populated if your use a Lookup Issue action. You don't appear to have one of those. Refer to this page for details on the Lookup Issues action.

https://confluence.atlassian.com/automation/jira-automation-actions-993924834.html

Second size is not the correct function so sum up numeric values from a list of issue. The correct function is sum. Refer to this page for more information about functions you can use with lists of issues.

https://confluence.atlassian.com/automation/jira-smart-values-lists-993924868.html

 

Note that the above page references are for the latest version of Jira Data Center. You should change the version selector in the upper right corner to the version that matches what you use to get the documents that align with that version.

0 votes
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.
November 28, 2024

Hello @Ismael 

@Bill Sheboy provided you with a solution path to explore - using the Send Web Request action in an Automation Rule to call the Rest API.

0 votes
Ismael November 28, 2024

Is there no way to do this with automation rules?

What is the technical reason for Jira Software Data Center 9.14, for not being able to do this with automation rules?

0 votes
Ismael November 26, 2024

I tried the following, without success:

tempsnip.png

Its correct?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events