Forums

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

smart value subtract from constant

Andrew de Quincey July 20, 2022

Hi, I'm writing an automation and I'm wanting to calculate the inverse of a numeric field in an issue.

For example, I have a custom numeric Issue field called bob with values from 1 -> 5

In my smart value I want to calculate "5 - <value of bob in the issue>"

I've tried doing the following, but I get `None` as the result. How should I do this?

5.minus(issue.impact)

 

2 answers

1 accepted

2 votes
Answer accepted
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.
July 20, 2022

Hi @Andrew de Quincey 

I can think of a couple of ways to do this:

  1. create a variable with the value of 5, and subtract your "impact" field from that
  2. a bit of algebra:  (A - B) = (B - A) * -1 and so {{issue.impact.minus(5).multiply(-1)}}

Kind regards,
Bill

Andrew de Quincey July 20, 2022

Ahhh duh, of course!

I think I prefer the second since it keeps it all together.

Thanks!

Like Bill Sheboy likes this
0 votes
Andrew de Quincey July 20, 2022

Got it: issue.impact.plus(-5)

Andrew de Quincey July 20, 2022

no no, I'm wrong, that's still not what I want.

Suggest an answer

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

Atlassian Community Events