Formula expression logic and operators
Asked by Phil Middlemass:

Hi, I've just discovered the JPD Beta and am already sold!  

However I'm looking to do something that probably isn't possible yet in the Beta, but hoping the community can help or the someone can confirm if what I'm looking is on the feature roadmap. Also JPD Automation doesn't appear to work for me at the moment so haven't delved in to that area yet to see if I can do what I want.  

I'm utilising the Formula Field, and writing a custom expression, however I want to be clever with how the formula is calculated based on the value of another field. In simple terms I want to use IF..ELSE logic in the expression (or the ternary JavaScript style IF..? :) to test a variable:

IF (a == true)  
{Value} \* {Effort}  
ELSE  
{Value} / {Effort}

As mentioned I can't access the JPD Automation, so this may be possible using the features in there, but it would be really cool to have logic and operators in the formula field expression to get creative with that field.


Answers:
author: Hanna
body: Hi [@Phil Middlemass](/t5/user/viewprofilepage/user-id/4994399)  

Thank you for this suggestion, currently, it's not possible to write a formula like this. I'll add it to the list of ideas for Jira Product Discovery.   

Cheers!

comments: author: Phil Middlemass
body: Thanks [@Hanna](/t5/user/viewprofilepage/user-id/1720410)

As I can't access the Automation features right now, do you know if they are capable of achieving a simple IF..ELSE or are they not that advanced yet?


author: Omer Meshar
body: Hi [@Phil Middlemass](/t5/user/viewprofilepage/user-id/4994399) ,

I have access to automation on my JPD project, and it does have the 'if block' condition, so I am guessing you could potentially implement what you seek.

![JPD1.png](https://community.atlassian.com/t5/image/serverpage/image-id/208717i518AF580269A48C5/image-size/large?v=v2&px=999 "JPD1.png")


author: Phil Middlemass
body: Thanks [@Omer Meshar](/t5/user/viewprofilepage/user-id/4828263)

That looks promising, hopefully (could you check and confirm), the 'Create Variable' action is available too. If so then yes I/we should be able to implement this kind of calculation and field update through automation.

Phil.


author: Omer Meshar
body: Confirmed.


author: Phil Middlemass
body: Awesome!

Just need my service request for Automation access in JPD issue to be resolved


author: Adam Chapman
body: Any news? We have a use case for this, as we have an "Impact" score and an "Effort" score. We have a formula of this:

(({Impact} \* (6 - {Effort})) / 25) \* 100

To determine the priority of our work, however, we've included that high-impact, high-effort items are never looked at as the priority is reduced significantly. We want to ensure that if the impact is 5/5, then the priority is always 100%. Any ideas?


author: Tere Pile
body: [@Hanna](/t5/user/viewprofilepage/user-id/1720410) given original comment/reply was July 22, curious about the state of more advanced write your own. value1\*2 + value2 + value3\*2 + value4 / effort - we use Fibonacci for our scoring and weight w/multiplier on 2 values. Having a more advanced formula would avoid using 2 systems to maintain information.


author: Bill Sheboy
body: Hi [@Phil Middlemass](/t5/user/viewprofilepage/user-id/4994399) -- Welcome to the Atlassian Community!

Yes, and...I'd like to see the same thing (formulas) for filters in views in Jira Product Discovery. The only work-around I can think of is adding custom fields solely for the purpose of filtering, and setting the values with automation rules.

Kind regards,  
Bill


Tags: expression

formula