I want the Story Points field for the parent story to be the sum of the sub-tasks.
I tried using the {{triggerIssue.Story Points}} + {{issue.Story Points}} option but that continues to add if we adjust.
Example:
Subtask A = 12
Subtask B = 10
Story 1 = 22
This is fine so far...
Subtask A: 12 -> 15
Story = 37 (not 25 like it should)
I want it such that whenever I update a sub-task estimate, it queries all subtasks and adds their story points OR if it detects a change, subtracts the previous value, and adds the new value,
Hi Eric,
thanks for your message.
You should be able to use {{subtasks.Story Points.join(" + ")}}
Let me know if that doesn't work for you!
Cheers,
John
It works well, thanks! Where can I find good documentation about that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good to hear!
We do have some docs around the smart fields here:
https://docs.codebarrel.io/automation/smart-fields/working-with-lists.html
However, truth be told, they are not as comprehensive as we would like.
I am in the process of putting together more detailed docs, vids, and webinars over the next few months. In the meantime, feel free to reach out if you run into any roadblocks!
Cheers,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I had tried using
"{{subtasks.timetracking.originalEstimateSeconds.join(' + ')}}"
and
"{{subtasks.originalEstimateSeconds.join(' + ')}}"
but non of above working It shows below error
Error while rendering additional fields.Invalid method call syntax
and on top of that got one question.
If originalEstimate is in day/min/hrs/week then how It will work?
subtasks.originalEstimate.join(' + ')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I just discovered this post.
I've been trying to get story points for an EPIC to sum from multiple Tasks linked using the EPIC link. I've tried the suggestion {{subtasks.Story Points.join(" + ")}} and also used {{issue.Story Points.join(" + ")}}. Using Smart values doesn't appear to work when I JIRA automation rule.. Any suggestions as to why this wouldn't work?
Thanks
Ged
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ged,
At the moment, this isn't possible with Automation for Jira.
We have an existing improvement issue here which I have added your vote to: https://codebarrel.atlassian.net/browse/AUT-475
If you are new to smart values within automation for jira, here are two good resources to help:
Docs: https://docs.automationforjira.com/smart-fields/smart-fields.html
Blog: https://docs.automationforjira.com/smart-fields/smart-fields.html
Hope that helps!
Cheers,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any updates on this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kavit, i have a response:
{{#=}}{{#=}}{{subtasks.timetracking.originalEstimateSeconds.join(" + ")}}{{/}}/3600{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks JC! With following adjustment, I was able to now sum up the estimates of all subtasks.
{
"fields": {
"timetracking": {
"originalEstimate": {{#=}}{{#=}}{{subtasks.timetracking.originalEstimateSeconds.join(" + ")}}{{/}}/60{{/}}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
UH? as a non techy person I have no idea where this code is supossed to go
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the Additional Fields text box.
See screenshot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By the way, I finally got it to work for me by using this code shared above.
{
"fields": {
"Story point estimate": {{#=}}{{subtasks.Story point estimate.join(" + ")}}{{/}}
}
}
However, I had to adjust the "Story point estimate" part because we're actually using a custom field called "Story Points" for this for some reason. This took me a while to figure out. In the end what helped me was this article here: https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/ There is a paragraph on "Referencing issue fields" which showed what it needs to look like for custom fields. So in my case the code now actually looks like this:
{
"fields": {
"customfield_10021": {{#=}}{{subtasks.customfield_10021.join(" + ")}}{{/}}
}
}
I hope this can also help some other people ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're amazing @Stefanie Häuser !! I've tried so hard to make this work and you help me a lot! Your solution works for me as well!
Thank you very much for share with us :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you SO much @Stefanie Häuser !
I have one further issue - perhaps someone of you has a solution.
In our team, we are using this rule to work more smoothly with Jira. The developers don't have to remember to update the Story Points of a Story when there is change in the subtasks (e. g. new subtasks, other amount of Story Points, etc.)
This rule works perfectly for us als long as we don't have a 'Done' subtask in our story.
The goal is, Subtasks with Status = 'Done' shouldn't be included in the calculation. How can I add this condition into my automation?
You can see my actual try in the screenshot. The result is, that as long as there is a subtask with the status = 'Done', it won't calculate anything (which makes sense in my opinion)
Any ideas? :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm getting a JSON error. any thoughts?
{
"fields": {
"Story point estimate": {{#=}}{{subtasks.Story point estimate.join(" + ")}}{{/}}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Martí Bastida Comas I was able to resolve my issue with:
When Value changes for story point estimate
if epic exists
for epic (Parent)
then lookup issues:
"Parent"={{issue.key}}
and edit issue fields:
{
"fields":
{
"Story point estimate": {{lookupIssues.customfield_11204.sum}}
}
}
Ultimately, this looks up the parent epic for the task that was just edited and then sums all "story point estimate" fields for any task/ticket that has that epic as a parent and stores the sum in the Epic's story point estimate field.
I don't remember how I came up with custom field #11204 as it's been awhile since I figured it out. I think I figured it out by doing an advanced export of a search that included that field. I'd wager there are other ways to find that number.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow, really appreaciate it. I will definetly take a look at your solution :)
PS: I think that never in my life a like in a comment triggered such a fast and informative response ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much Stefanie Häuser
You saved hours of my effort. That's exactly what I was looking for.
Best Regards,
Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry for necro.
For next-gen, {{subtasks.Story Points.join(" + ")}} will not work properly.
Use "Story point estimate" .
{
"fields": {
"Story point estimate": {{#=}} {{subtasks.Story point estimate.join(" + ") }} {{/}}
}
}
or
{
"fields": {
"Story point estimate": {{#=}} {{#subtasks}} {{Story point estimate}} + {{/}} 0 {{/}}
}
}
Looks like this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did any one face this issue ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did. Did you solve this ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I face this issue too.
My project is next-gen Jira software project.
I thought the "story point estimate" is origin create by Jira
because the issue type setting
Then I find the "Story point estimate" is custom field
You can find your customfield id by this tutorial : https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/
And I set Additional fields to My project setting id
{
"fields": {
"customfield_10016": {{#=}}{{subtasks.customfield_10016.join(" + ")}}{{/}}
}
}
It works. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This finally works, using the smart value, thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all!
Perhaps it helps to somebody else. I could sum up the estimates of all subtasks and set it as the estimation of the parent issue. This is the code:
{
"fields": {
"Story point estimate": {{#=}}{{subtasks.Story point estimate.join(" + ")}}{{/}}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey there, I thought I'd try your code as the last code I had in wasn't always reliable. Or maybe it's the trigger itself. It doesn't always fire and sometimes the total is incorrect until I refresh the page. Any thoughts?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Mikaela Bertucci , I think that the total is always correct. The problem is what you mentioned: The UI doesn't update automatically after an event is fired, so you need to refresh manually. If sometimes it doesn't fire it could be because of a misconfiguration in your "when" and "if" conditions (they are not part of the code that I uploaded). Or maybe it always fires but you don't notice because you don't see any changes on the UI until the manual refresh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not working for me either. It's giving me "Not valid JSON"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@John McKiernan Hey thanks for those tips! I'm trying to set up this subtask story point automation. I followed your instructions. The audit log tells me that everything worked successfully when I test it. However, the story point field does not get updated. Any ideas why this might be?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @John McKiernan1 I have the same problem than @Stefanie Häuser , I am using Next gen project and trying to have "Story points of parent issue = sum of the story points of child issue". My parent issue is a Story.
I tested with {{childissues.Story points.join(" + ")}} and {{subtasks.Story points.join(" + ")}}.
My audit log writes the changes as a success but my field "Story points" in the parent issue isn't updated .
Can you tell us what can be wrong in our rules ?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same problem :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@M_Y_ or anyone managed to get sum of standard issue story points into Epic Story Points? If so, please can you share your smart value details.
I also tried the same Smart Values:
and the log says success for both but story points aren't updated in the Epic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there, Im desperately trying to achieve the same thing here - sum up of story points to Epic level using automation. Any further developments on it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am having the same issue. My rules run without any issues but can not see the story points on the stories. Looking forward for the solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I achieved an Epic roll up through a scripted field in Scriptrunner. I created a field called "Aggregate Story Points" and then used this code to get the results I was looking for. Works really well.
import com.atlassian.jira.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor;
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def cfManager = ComponentAccessor.getCustomFieldManager()
double totalSP = 0
customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectsByName("Story Points");
enableCache = {-> false}
issueLinkManager.getOutwardLinks(issue.id)?.each {issueLink ->
double SP = (double)(issueLink.destinationObject.getCustomFieldValue(customField) ?: 0)
totalSP = SP + totalSP;
}
return totalSP as Long ?: 0L
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Will it add up all subtasks and stories under it? Like all story points for epic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone,
Is it possible to do the operations you mentioned for tasks, not subtasks?
Instead of using sub-task on the board, we split the tasks into tasks and I cannot automatically save their scores to the story.
I tried {{tasks.Story Points.join(" + ")}} but it didn't work.
You can see my flow in the attachment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there, above codes update the Story point estimation field. If you want to update the Story points field as well then add below code:-
{ "fields": { "Story point estimate": {{#=}}{{subtasks.Story point estimate.join(" + ")}}{{/}} , "Story points": {{#=}}{{subtasks.Story point estimate.join(" + ")}}{{/}} } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In Jira Cloud - I could get the sum of story points of subtasks on the parent story successfully using Smart Value: {{issue.subtasks.Story Points.sum}}. But the only issue is when a sub task is deleted it doesn't recalculate the story points and update the parent story. Any suggestions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For this scenario I would run a scheduled rule at midnight that cleans up all the story points. Take a look at this video and follow rule #3: https://www.youtube.com/watch?v=PROcxEOMyGM&t=13s
You would just needs to update the branches to do it on the Parent task.
Regards,
Fabian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Everyone,
Here is a link to a tutorial on how to sum up subtasks: https://www.youtube.com/watch?v=60sWD66l19k
The key smart value formula is: {{issue.subtasks.Story Points.sum}}
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Fabian.
I have written the smart value formula on Story point estimate instead of Story Points as we are using Story Point Estimate. If i go to the automation, I see that the automation is running correctly, it is editing the story, and I am also getting emails from Jira Automation showing the correct story points. However, I am not seeing it on the backlog.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Saket Gune
You may have to set the board to show Story Points Estimates instead of Story Points then.
Here are the instructions on how to configure the board: https://support.atlassian.com/jira-software-cloud/docs/configure-estimation-and-tracking/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fabian,
Thanks. I went through the instructions but I can not see Board Settings I am the administrator for the project. I only see Configure Board. Here are my user settings.
I also do not see Active Sprint Menu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your backlog, go to the top right corner:
However, I recommend you stick with Story Points because once you start the sprint and complete it, you want to ensure that the reports are tracking the actual story points and not the Story Points estimate.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Fabian.
I can not see it. Is this feature available for a standard subscription? I am currently on a free subscription.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Fabian,
Thanks for all your help. I was able to figure it out. The reason I was not able to see the options is that I was using the incorrect Project type. I was using the team-managed project. I created the new company-managed project and it enabled me to see the screens you had mentioned in your response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does anyone know why I see two options for Story Points when i am creating the automation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That usually happens when you have two customfields with the same name. Check your customfield in the sys admin configurations.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Guys,
I have one further issue - perhaps someone of you has a solution.
This rule of calculating Story Points of subtasks works perfectly for us als long as we don't have a 'Done' subtask in our story.
The goal is, Subtasks with Status = 'Done' shouldn't be included in the calculation. How can I add this condition into my automation?
You can see my actual try in the screenshot. The result is, that as long as there is a subtask with the status = 'Done', it won't calculate anything (which makes sense in my opinion)
Any ideas? :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dominique Brandt, @Akshay Vadher, @A_lis
This solution is working for me to sum the "story point estimate" field of any task with a given epic, when that task's status is not "complete" or "project dropped" and fill in the epic's custom field of "story points remaining". I'm not sure if it will work out of the box for sub-tasks because I do not use sub-tasks, but I think it will work for any task/story/subtask? You can also change it to simply look for not "Done".
You will want to update which fields you are summing and updating, but the search for which tasks to sum should be valid for you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Akshay Vadher I assume you mean "sum" when you say "Join"? If so, you should be able to modify my example at the Lookup Issues section to meet your needs. you can use status != "Done" and you can even add in a type = subtask (or something similar) if you want to make sure you are ignoring normal tasks and stories that might be part of the epic.
Then you will want to update the Edit Issues portion so that you are summing the correct field (my custom field ID numbers will be different than yours, and you may be able to just use the field names directly).
Hope this gets you going in the right direction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Akshay Vadher and @Brad Christiansen
I am trying to achieve the same thing but using the following
Could you help with the query because I am not sure how to use your query with my settings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Uh? as a non techy person.. where is this code supposed to go?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Project Settings > Automation
And then you have to create the flow they show in previous comments.
At the last step you can use the code they shared
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.