Hi there,
I have a Jira DataCenter with ScriptRunner and Automation for Jira i have 2 questions:
1) How can I calculate 2 fields ? Example field 1 + field 2 = result in field 3
2) How can I pull from the web an exchange rate for a currency example from USD to EUR in a field ?
At the end, i would like to calculate field 1 + field 2 and display a sum calculated by the currency exchange rate.
Example:
Field 1 = Man Hours
Field 2 = Labour Hours
Field 3 = Total from field 1 + field 2 - and from here to display the result in a currency.
If the total would be 50 hours and 1 USD = 0.97 euro means i have to pay X amount in euro
Any help would be greatly appreciated.
Thanks
This is the documentation for both of your request:
https://scriptrunner-docs.connect.adaptavist.com/jiracloud/scripted-fields.html
For 1, just see the sample that sumps up the story points. Your use case is actually a simplified version of this.
For 2, there is an actual currency conversion example. (There are other public websites with currency exchange rates, but the recipe is the same: send a request to service, then parse out the rate value from the response and multiply the CF value with that.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.