Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Story Point Calculation Based on Complexity & Time

John DiMaria January 9, 2025

I'm looking at how I can create an automation that calculates SP based upon the task complexity field (easy, medium, hard) and the time tracking field native to Jira. Task complexity is a custom field (10347) and it time tracking is in hours.

Still pretty new to this, but basically what I started off with was this:

{{#=}} {{#if(issue.customfield_10347.equals("Easy"))}} {{issue.timeTracking.timeSpent / 8}} {{/}} {{#if(issue.customfield_10347.equals("Medium"))}} {{issue.timeTracking.timeSpent / 8 * 2}} {{/}} {{#if(issue.customfield_10347.equals("Hard"))}} {{issue.timeTracking.timeSpent / 8 * 3}} {{/}} 0 {{/}} 

What I believe is happening is that the custom field is more or less failing and then i default into 0 SP.

2 answers

0 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.
January 10, 2025

Hi @John DiMaria 

Though I do not recommend translating quantified-measures to relative-sizing ones, you may want to try using a Lookup Table rather than a complicated conditional expression.  That will be much easier to maintain and understand.  Please look here to learn more:

https://community.atlassian.com/t5/Automation-articles/Update-Create-lookup-table-action-improvements/ba-p/2427798

 

To your original question, select-option fields provide the option id as the default, rather than the value attribute, and so your expression was trying to compare something like "2" to "Easy".  If you add the value attribute and improve the test, I suspect that expression would work.  Also, it is unclear if you wanted that trailing 0 at the end to be in the front instead.

{{#if(equals(issue.customfield_10347.value, "Easy"))}} ... {{/}}

 

Kind regards,
Bill

0 votes
Atlass Monster
Banned
January 9, 2025

@John DiMaria  Hi

You should round the values, up or down. A value of 2.5 story points may not work. 

Look for round, ceil, floor https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

John DiMaria January 9, 2025

Hi!

I don’t think this is the issue here as I can apply decimal values to the story point field. It looks like when I log the custom field it displays nothing which is strange as it should display the value from the dropdown value.

John DiMaria January 10, 2025

I think i will opt to use "if" components in the automation itself. it seems to be working and might just be an easier, but less elegant solution in this case.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events