Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

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

Sum up Custom Estimation Fields

joscha_reinhard October 21, 2024

Hello together, 

I have tried many otpions with JIRA automation to solve my requirement but without success...

My goal is to set up one/many JIRA automation that sums the values from three custom fields (Effort CON, Effort DEV, Effort INT) of User Stories and updates this sum in the "Sum Effort CON", "Sum Effort DEV" & "Sum Effort INT" field on the associated Epic.

For Example: 

Story 1:
Effort INT = 1
Effort DEV = 10
Effort CON = 1

 

Story 2: 
Effort INT = 1
Effort DEV = 1
Effort CON = 1

Parent Epic: 

 

Effort INT = 2
Effort DEV = 11
Effort CON = 2

 

Hope you can help me. 

Thanks in advance! 

 

Regards, 

Joscha

2 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.
October 21, 2024

Hi @joscha_reinhard -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!

Until we see those...

At this time, the Lookup Issues action for Jira Data Center automation does not support custom fields: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877

For your scenario to update the parent issue with those fields, a workaround is to use the Send Web Request action to call the REST API for issue search with JQL, and then use the web response to sum the fields.

Please see this earlier post where I describe the approach in more detail: https://community.atlassian.com/t5/Jira-questions/Re-How-to-sum-story-custom-filed-values-to-an-epic/qaq-p/2787339/comment-id/1043853#M1043853

Kind regards,
Bill

joscha_reinhard October 22, 2024

Hi @Bill Sheboy 

I have tried your way mentioned in your post (I am new on JIRA Automation). 

Attached my complete automation. 
I hope you can assist..

Trigger: 
Snag_9de1e09.png

If Clause: Story

 

Snag_9deedeb.png
Send Request: Snag_9e295f4.png

 

Compare: Snag_9e32d04.png

 

Edit: Snag_9e38b80.png

 

Customfield ID: 
Snag_9e40747.png

 

Here the Audit Log after changung the field Value of field "Effort CON" 
Snag_9e55c96.png

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.
October 22, 2024

Your Send Web Request action appears to be calling the wrong endpoint.  Instead use the issue search, passing the JQL as a parameter:

https://docs.atlassian.com/software/jira/docs/api/REST/9.13.0/#api/2/search-search

joscha_reinhard October 23, 2024

Sorry for asking again, but how exactly should I implement this?
Issue search is known to me via the lookup function.
But here I mean knowing that it doesn't work for custom fields

joscha_reinhard October 24, 2024

Hi, 

I made a change at the URL "*/rest/api/2/search?jql=cf[10108]={{issue.key}}"
I still get the error: "NO ACTIONS PERFORMED"

cf[10108] = Epic Link 

image.png
image.png

 

 

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.
October 24, 2024

Please show an image of the audit log details for the rule execution, obscuring your site URL.  That may provide context for what you are observing.  Thanks!

joscha_reinhard October 25, 2024

Hi Bill, thanks for your time & help

Here are two screenshots: 

First: Branch for "Epic (Parent) + logFIle
Snag_a178ea0.png

Second: Brachn for Parent + logFile

image.png

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.
October 25, 2024

If you use that REST API URL with an example Epic key in a browser tab, does it work as you expect?

joscha_reinhard October 28, 2024

Hi, 
Yes I think that worked as a expact. 

Here the a whole epic: 

Snag_19b294b3.png

 

Here the search for the specific custom field: 

image.png

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.
October 28, 2024

The second image is showing no issues found.  If you run that JQL standalone outside of the rule, what do you see?

cf[10108]=ISE-10

 

joscha_reinhard October 28, 2024

Hi Bill, 

in this case that was my fault. 
My custom field ID is cf[10200].

With the correct string the API call works. 

image.png


Searching in the Issue seach with the JQL statement also works fine: 
image.png

joscha_reinhard October 28, 2024

Hi Bill, 

i now get this errorimage.png

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.
October 28, 2024

That seems to be an authorization error.

Who is the actor for your rule?

Have you changed the API token while updating the rule?

joscha_reinhard October 28, 2024

I have not changed the API Token. 
Created as mentioned in this post (https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828)

Base64<Mail>:<API Taken created from Atlassian>

Maybe it doesnt work with the Token from Atlassian Account? 

Our Environment is on Data Center and I don't think we use Atlassian credientials. 

I have tried to create a "personal Access Token" for a Admin User and created a API Token for JIRA as described in the above mentioned post with encodung base64.


Base 64
<Mail>:<Personal access token>

Same error...

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.
October 28, 2024

Sorry, I am not using Data Center version and so cannot experiment with something which is in your site configuration.  If the suggestions from that linked how-to article did not work, perhaps try:

joscha_reinhard October 31, 2024

Hi Bill, 

I have solved the problem with authentification! 

However, I’m currently stuck on transferring values from my custom field "Effort CON" at the User Story level to the custom field "Sum Effort CON (cf[10220])". I’ve attached the error logs for additional context.

Maybe its the Webhook urls thats not working? 

"/rest/api/2/search?jql=cf[10220]={{issue.key}}" 

cf[10220] is the CF on Epic Level 

Snag_a7ee8c1.png

LogFile: Snag_a7f472d.png

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.
October 31, 2024

Please remove the expression from the Additional Fields section; that is used when you need JSON to update fields.

And then paste this into your Sum Effort CON field:

{{webhookResponse.body.issues.fields.Effort CON.sum|0}}

The smart value will appear below the field, and then you may select it for usage.

 

If that does not work, please try using the custom field id for the Effort CON field instead of its name / smart value.

joscha_reinhard October 31, 2024

Hi Bill, 

same error: Snag_bec980c.png

Not sure why the error message is: ""Value 'ISE-10' for the 'cf[10220]' field is not a valid number."


How can I use die CF Field with cf[10220]?

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.
October 31, 2024

Ah...your field cf[10220] appears not to be the issue key, leading to that error message.

In your original question, you were trying to gather the child issues of an Epic to sum the fields.  If that is still the case, please change the JQL part of your web request URL to

"Epic Link"={{issue.key}}

 

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
October 24, 2024

Hi @joscha_reinhard

I trust that with the help of the community, you'll get this to work in Jira Automation!

Just as food for thought: If you're open to solutions from the Atlassian Marketplace, you'll find a number of apps that are more targeted towards your use case. If that's an option, you may want to have a look at the app that my team and I are working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a long list of advanced features, including support for (configurable) issue hierarchies, issue grouping by any issue field(s), and sum-ups. 

With these, you can build a view like e.g. this in just a couple of clicks:

sum-up-efforts-v2.gif

Note how the sum-up on the epic updates in real time as we work on the issues below.

This is really just one of a virtually endless number of possible views and reports; you can also view and group by any other issue fields, configure different sum-up styles, etc. etc.

This all just works - there's no scripting or automation whatsoever required.

Any questions just let me know,

Best,

Hannes

Suggest an answer

Log in or Sign up to answer