Story point estimate type can it be used for mathematical computations
Asked by Dipen:

Hello Atlassian Team

We have a Custom field called Story point estimate (Locked field) that is of type: Story point estimate Value.

I have another Custom field called Aggregate Story points which is of type: Number.

I am trying to compute the total number of Story points that were Committed at the end of the Sprint cycle.

Wrote an automation rule that would do the following:

Total Story points: {{issue.customfield_10369.plus(issue.customfield_10236)}}

I have printed the value of customfield_10236 prior to doing this computation for the 2 issues that I am testing with.

But it has'nt helped. Implying that the Aggregate Story point value is Empty.

Just trying to figure out what am i doing wrong?

Any pointers would be greatly appreciated.

Thanks

KD


Answers:
author: Bill Sheboy
body: Hi [@Dipen](/t5/user/viewprofilepage/user-id/5462529)

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...

You note the "Story point estimate" field, and so I am assuming you are using a *team-managed project*.

What is your rule trigger? For example, you seem to be doing this one-by-one for the issues rather than for the set of issues in the sprint.

If instead this happened when Sprint Completed triggered, you could use a Lookup Issues action with JQL to gather and sum the storing points for the completed issues to set the field:

```
{{lookupIssues.Story point estimate.sum|0}}
```

Kind regards,  
Bill

comments: author: Dipen
body: Bill

Thank you for your response back.

I totally agree with your response. However teh automation rule that I have in place is bare bones wherein I am testing if the matematical computation will work or not. And for that I have limited the # of issues to 2 only.

Once the rule works then I can try and implement what you have suggested.

However it appears that the computation that I am testing with may not work at all since

Custom field: Aggregated Story points which is of type Number field and

Custom field: Story point estimate (locked) which is of type Story point estimate value are 2 different types. Is that the correct understanding.

Also as you rightly pointed out this is a team managed project. Sorry I should have been more specific in my initial ticket request.

And I am hoping to add all the Story points that were committed at the end of the sprint for all issue types.

The one question that I would like to run by you is with the solution is presented above:

```
{{lookupIssues.Story point estimate.sum|0}}

```

If I were to implement this which variable stores the value of all the Story point estimates for all Issue types ?

Thank you for your help in advance.

Sorry for not posting the Automation rule as I don't want to mis-lead anyone.

Thanks

KD


author: Bill Sheboy
body: There should only be one field named "Story point estimate" in your team-managed project, and it is numeric.

Regarding your earlier expression, assuming that customfield_10236 is your "Story point estimate" field:

```
{{issue.customfield_10369.plus(issue.customfield_10236)}}
```

That will only produce a number if customfield_10369 already contains a number. If it is null, it will collapse to null. A workaround for that is to use this math expression, with a 0 default at the front:

```
{{#=}}0{{issue.customfield_10369}} + 0{{issue.customfield_10236}}{{/}}
```

Regarding my example using lookup issues, the result could be stored directly in your custom *Aggregate Story Points* field by pasting it into the edit field, or written to the log, etc.


author: Dipen
body: Joe

You have been very kind to reply back to my messages. Really appreciate your feedback.

Here are some responses to your comments

"There should only be one field named "Story point estimate" in your team-managed project, and it is numeric."

You are correct there is only 1 field Story poitn estimate, however the way this project was built before me stepping on board is the that type of that custom field is Story point estimate value and not Numeric.

You are also correct in stating these 2 things

customfield_10236 is "Story point estimate" field where as

customfield_10369 is "Aggregated Story Points" Type is Number field. And is Empty. Hence I tried both the variations with the workaround default value of 0

Just a couple of quick things to check with you.

I tried running 2 variations of this piece of code as per suggestion above, however I am getting the following message

Piece of code you suggested

```
{{#=}}0{{issue.customfield_10369}} + 0{{issue.customfield_10236}}{{/}}
```

2 Variations of this

{{#=}}0{{issue.customfield_10369}} + 0{(issue.customfield_10236}} {{/}}{{#=}}0{{issue.customfield_10369}} plus{(issue.customfield_10236}} {{/}}

None seem to work.

Error I get

Unknown operator { at character position 7: 0. + 0{(issue.customfield_10236}}

Am I missing something from a syntax perspective. Tried google searching but have'nt had much luck.

Thanks

KD


author: Bill Sheboy
body: I do not believe it is possible to change the type of the built-in "Story point estimate" field from numeric to anything else.

If someone has created another field with the same name, that will certainly cause problems. I recommend pausing to learn why they added another field.

Until then, first use this how-to article to confirm you are using the correct custom field id values for the fields: <https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/>

Next, please review that error message and you will observe you used a parenthesis rather than a curly-bracket at one location.

Please use **exactly** what I posted and it should work if those are the correct custom field id values.


author: Dipen
body: Bill

You are right on target. That was it. Replaced the parenthesis with curly-bracket that resolved the error.

Here's the response to the some of your other comments

1. Story point estimate - only 1 field exists for the Team-managed projects. Again re-iterating just for clarity - The type for that field is set to Story point estimate value. That field is locked status

![Screenshot-2024-06-27-174059.png](https://community.atlassian.com/t5/image/serverpage/image-id/332275iC462BE3540071384/image-size/large?v=v2&px=999 "Screenshot-2024-06-27-174059.png")

2. This piece of code works now

```
{{#=}}0{{issue.customfield_10369}} + 0{{issue.customfield_10236}}{{/}}
```

Moving on to the next phase of this automation code. since the value of the aggregate story points is not cumulating.

Thank you for pointing out the bug. Much appreciate.

--Dipen


author: Bill Sheboy
body: Sounds like progress is being made!

How are you trying to accumulate the story points, and when would you do so?

Often this is done when an issue completes, or when a sprint completes. Then the Lookup Issues action is used with JQL to gather all of issues to sum:

<https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Lookup-issues>


Tags: jira-service-desk-cloud

jira-service-management

jira-service-management-cloud