Please see the calculated number field we need written below. I would love some help in writing the script to accomplish what we would like to accomplish. Column A (A-G) are the fields. Columns B-F are the options that can be entered for the given field. And the last row (Total Marks in Category) is multiplied by a given number depending upon what is entered as an option for the given field. Please let me know if there are any questions.
Here is a zommed in version of the original image I included.
What are you planning to use to calculate this?
I did some research and downloaded this add-on which allows you to use a "Calculated Number Field"
https://marketplace.atlassian.com/plugins/com.innovalog.jmcf.jira-misc-custom-fields
You could also try Script Runner, there is an example of the principal of what you are trying to do here: https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted%20Fields#ScriptedFields-Calculateanumberbasedonotherfields
Here is what I have so far for the calculated number field. Can someone please take a look and help me out with this?
@Formula:
issue.get("customfield_13603") != null ?
if (value === 6)
return (value * 2);
if (value === 7)
if (value === 8)
if (value === 9)
if (value === 10)
-->
Hey Campbell,
We just spoke on the phone. Regarding your questions about the Calculated Number Field custom field from the JIRA Misc Custom Fields, you can get further help from Innovalog's Support team please see this Getting Support page.
Cheers,Matheus
I have just edited your question to add this add-on's tag so that the Innovalog team can see it.
As of now I am only worrying about Field A (Eventually we are going to create Fields B-G). So let's just say I have created 1 custom field for now. This field is a radio button field with 5 options: 0, 1-5, 6-10, 11-15, and 16-100). The 1's in the cells mean that the user is selecting one of these options. I understand the 1 can be confusing (I didn't create the spreadsheet), so I would just think of it is a checkbox.
If O understand correctly, you have created 7 custom fields on your issues, named "A" to "G". What is the field type of these fields?
Also, I don't understand your Excel spreadsheet. What do the "1"s in the cells mean? I would assume that your fields are of type "Select", and you have created possible values equal to "0 (default)", "1-5", etc. Right? And thus the user can select a value for each field?
You might want to try something like:
Option val = issue.get("customfield_13603") if (val == null) return null; if (val.getValue().equalsIgnoreCase("0 (default)")) return 0; if (val.getValue().equalsIgnoreCase("1 - 5")) return 1; ...
Thanks David for getting back to me. I have entered in what you have suggested and nothing is being populated into the field. I am not sure what is wrong because there are no error messages or anything.
Great, thanks. Can you let me know where exactly in the logs I should be looking?
It looks like you're new here. Sign in or register to get started.