Automation rule for calculating fee for multiple currencies

Van Le June 19, 2022

Within our project, we have created an automation rule that calculates the 1.5% fee associated with running a campaign. This fee is calculated based on a field that takes a numerical value called Marketing Value. Currently, this field doesn’t handle non-numeric characters. The user must remove any $ signs and commas before they can submit the form.

The problem is that there is no default currency, so if the user removes the dollar sign or euro sign for example. Our team may think the sum is in USD.

Our current solution is to have another column to fill in the currency. Just wondering if there is a way that satisfies both requirements, which is having the Media budget field as a text field so the non-numeric characters don’t need to be stripped and we still be able to calculate the 1.5% fee from this field?

3 answers

0 votes
Ivan Lima
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 21, 2022

Assuming you're using Automation for Jira, you can try replaceAll by using something like {{issue.Marketing Value.replaceAll("([0-9])","")}}

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#replaceAll-String-regex--String-replacement-

0 votes
Van Le June 19, 2022

Thank you for the swift reply.

 

I was wondering if there is a way to detect all non-numeric values in a text field, and then remove them from the text field. We will then use the syntax (value).asNumber to convert the value from text to number?

 

Thanks in advance for helping :) 

0 votes
Ivan Lima
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 19, 2022

If you cannot standardize to a particular currency, it would be easier to have something like "Marketing Value (USD)," I'd keep your field as a number rather than trying to manipulate the string. Although possible, I always find it tricky to predict and implement the rules to make them work properly. By keeping them separate, I believe you will have more control over further calculations you might need. And, of course, I'd also explore marketplace apps that would address that for you.

Suggest an answer

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

Atlassian Community Events