Hi Team
Can calculated values in Jira be done with using JMCF add-on? For example, if I have a field called ‘Salary’ and another field called ‘Pay Cadence’ and a third field called ‘Rate Amount’, can it be done such that…
If ‘Pay Cadence’ = “Daily” then ‘Rate Amount’ = (‘Salary’/8)
Else If ‘Pay Cadence’ = “Hourly” then ‘Rate Amount’ = ‘Salary’
Hi!
I think you can replace 'Pay Cadence' with 8 or 1 respectively and use the following formula:
'Rate Amount' = ('Salary') / ('Pay Cadence')
You can also have a small comment below the 'Pay Cadence' field explaining the numbers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let's say:
'Pay Cadence' - customfield_00001
'Salary' - customfield_00002
The calculation should be something like this:
<!-- @@Formula:
if (issue.get("customfield_00001") == null || issue.get("customfield_00002") == null)
return null;
return issue.get("customfield_00002")/issue.get("customfield_00001");
-->
All this needs testing. You'll never know what errors may emerge.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can also always refer to the documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg,
I have created "salary " text field and "Pay Cadence" single select values 8 and 1, then I have created "calculated number field" called Rate amount and I have added code in description,
but rate amount field I am not able to see in my screens I am sure i have added the same to all screens I am missing that fields from my screen s
Screen shot
and my formula
Salary = 10400 and Pay cadence = 10401
Screen shot:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use "Where's my field?" functionality:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg,
Looks good checking with where is my field
Screen shot:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, there should be something wrong with the calculation itself.
Use this add-on to check atlassian-jira.log:
There will be displayed calculation-related errors.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg,
Seems like formula error, can you look my formula above is it right?
Thanks
Nagaraju
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What type are your fields? ('Salary' and 'Pay Cadence')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tested the behaviour in my environment and it works like a charm:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I am using salary = number field type and pay cadance = single select type and rate amount = calculated text field (JMCF field)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it's better to make "Rate Amount" a Calculated Number Field type.
It worked in my case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh sorry Rate amount I have created calculated number field only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As long as you use a single select type field, I think it's better to do the following trick:
if (issue.get("customfield_10401").equals("1")) a = 1;
if (issue.get("customfield_10401").equals("8")) a = 8;
return issue.get("customfield_10400")/a;
You only have 2 options as 'Pay Cadence", right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh, you can even save your initial 'Daily' and 'Hourly' :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg,
I have tried this, it is working super. and I am using initial 'Daily' and "Hourly' as well this is also working good.
Thank you Greg... reaily you responded soon and very clear inputs thank you so much for your help.
Thanks
Nagaraju
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Nagaraju Reddy!
Glad it worked :)
You also might want to mark the answer as accepted so that other people with the same or similar question would find it easily.
Have a nice day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.