In this article we describe how to set up fields in your project. This configuration applies only for Company-managed Jira projects.
In this example, we discuss a situation where you already have a base value in your issue issue and you want to convert it to EUR or USD. In this example our base value is stored in the Price custom field.
⚠️ Updates take place only when user refreshes the page.
Adding Source and Target Currency fields
First, we have to add Source Currency and Target Currency fields on issue’s screen to give users ability to edit this fields.
Go to the list of projects. Select a company-managed project and go the Project Settings.
Then, select Screens menu tab from the left panel.
Select any screen you want depending on your requirements. In our example we add these fields to every screen.
Add fields Source Currency and Target Currency to your screens.
Now our View/Edit issue screen looks like this:
Now we could set a base currency for our Price field and set currency we want convert to. In our example we will convert 130 USD to UAH.
Creating Exchange Rate Calculation field
Now, we should create field that displays calculated value. For this purpose we create a new field called Result Price.
Go to the the Issues settings.
From the left panel select Custom Fields. Click “Create custom field” button.
Click Create and select Currency Exchange Calculation Result field type.
Set the name for your field. Now, you can add this field to your screens (like we did it for source and target currency fields).
Exchange Rate Field Configuration
For change field configuration, we should edit field context. Find your field and select Context and default value.
Then click Edit custom field config.
Field configuration page allows you to set up source and target currency and source value need to convert. You can set source and target currency manually and that would be applicable for all issues. Amount field is used for getting source value for calculation.
Date field is used when you want to get rates for the specific date in the past(for example, our task has a Start Date field and we would like to use currency rate based on this field value). This field is optional. By default we use current date.
Update field configuration:
In this example we get source currency from the Source Currency field and target currency from the Target Currency field (we created them before in this tutorial). Amount is getting from Price field. We don’t use any historical values, we need actual exchange rate.
Let’s check our issue
Our Result Price field shows how much costs 130 USD in UAH.
Why it’s so complicated?
You may notice that this simple solution requires a lot of work: creating, adding field to the screen, configuration, etc. But we focus on flexibility: you can configure Exchange Rate Calculation field as you want, adding custom contexts, get source and target currency values from the other (non plugin fields).
If you have any questions, contact us here.