Forums

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

Smart value expression returns a negative number, even though I'm using .abs!

Monica Brazelton
Contributor
January 4, 2024 edited

Hello Jira community!

I'm trying to do something that I thought would be simple and running into an issue, hoping someone here can help enlighten me.

My goal:

  • Show the difference between two number fields, but only show positive values
  • In this case, I'd like to show the difference between the default 'Story Points' field and a custom number field called 'Actual Story Points'

What I've done:

  • When the value of 'Actual Story Points' field changes, my automation populates another custom number field called 'Estimate vs Actual Difference' using the smart value expression:
{{issue.Story Points.minus(issue.Actual Story Points.abs)}}

The issue I'm seeing: 

  • When the value of 'Actual Story Points' is greater than the value of 'Story Points', the automation populates a negative number into the 'Estimate vs Actual Difference' field
  • Example: 'Story Points' = 5, 'Actual Story Points' = 8, automation using the smart value expression above populates 'Estimate vs Actual Difference' field with -3
  • Based on the fact that I'm using .abs (documentation) in the expression, I would expect to see 'Estimate vs Actual Difference' = 3 in this case, not -3

Workarounds I've tried:

  • Created a dummy custom number field and replaced 'Story Points' in the automation's smart value expression with that dummy field name - still seeing a negative value returned in 'Estimated vs Actual Difference' field when 'Actual Story Points' is greater than the value in the dummy custom number field
  • Searching the Jira forums, where I found solutions that involved using .abs, which I'm already using in my smart value expression 

Does anyone have any ideas around what I'm missing here, or if this is a bug?

1 answer

1 accepted

2 votes
Answer accepted
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2024

Hi @Monica Brazelton ,

your .abs is in the wrong place in your formula. As it is now, you are applying it to the value of actual story points and not to the result of the calculation. It should be outside the curly brackets, like this:

{{issue.Story Points.minus(issue.Actual Story Points).abs}}

Hope this helps!

Monica Brazelton
Contributor
January 4, 2024

Yessss thank you @Walter Buggenhout! I had been staring at it for too long and was blind to my error lol. Just updated the smart value expression as you suggested and my automation is working now. I see a positive value regardless of whether 'Actual Story Points' is greater or smaller than 'Story Points'.

VERY much appreciate your help, thank you again!!

Like Walter Buggenhout likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, loom, AI, meeting recording, community

[NEW] Record your meetings with Loom

Welcome to great meetings, with less work. Automatically record, summarize, and share instant recaps of your meetings with Loom AI.

Learn more
AUG Leaders

Atlassian Community Events