The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi Folks,
This is for a project being used by our Tax department. I have 14 custom numeric fields for different tax types that I need to total into a "Total Amount Due" numeric field.
I've created an automation to do this which works if all fields have a value entered. I'm using the smart value below to update the "Total Amount Due". I can set this to trigger on issue update or on update of any of the specified fields, or even from manual trigger and it works fine if each of those fields have a value entered:
{{#=}}{{issue.Income Tax}}+{{issue.Franchise Tax}}+{{issue.S Corp Tax}}+{{issue.Business Tax}}+{{issue.Tax on Actual Distributions}}+{{issue.Built-In GainsTax}}+{{issue.Minimum Tax}}+{{issue.Pass-Through Entity Tax}}+{{issue.Composite Income Tax}}+{{issue.Nonresident Withholding Tax}}+{{issue.Annual Fee}}+{{issue.Other Amount Due}}+{{issue.Interest}}{{/}}
If any of the 14 fields mentioned do not have a value then the automation errors out. I'm curious if there's a way to accomplish this with treating Blank/Null values as a 0 or a "simple" way to ignore blank fields in the automation.
I can set a default value for these fields of 0 which corrects this but these are not all needed on every issue, so I currently have these fields hidden on the issue screen if they contain no value, in order to keep the screen from being too cluttered with irrelevant fields. I would like to preserve that if possible.
I also tested using "Else/If" blocks to specify if certain fields are empty to ignore them from the total. This works great for getting a total of 1 - 3 fields, but for 14 that's a lot of Else/If combinations.
Thanks so much for any assistance/suggestions.
Hi Jonathan,
Try this syntax for each field:
{{issue.Income Tax| 0}}
I believe with automation for Jira it isn't able to handle something as advanced as excluding values. The scripting in automation for Jira is pretty basic. If using scriptrunner you can write a script in groovy that accounts for this.
Best,
Clark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.