Greetings!
I have a project I'm playing with in a test environment where I've reached a couple stumbling blocks. I'm new to Jira admin and creating projects from the ground up, but I'm a quick study.
Project:
This will be used for attendance infraction tracking. Supervisors may enter occurrence values of 0.00, 0.25, or 1.00 through a Select List (single choice) field. (Ugh, I just learned that this stores the data as a string. Not ideal.) (Is there a better way? I'd prefer to not let supervisors enter via an open field.) (This is customfield_25002)
Once that's done, I have JQL that will show me all events that match certain filters, but I need a way to sum the customfield_25002 on all matching issues. I think a JMCF field will do it, but I'm banging my head against the wall.
I can't seem to get customfield_25002 to behave as an Integer. I'm not the best coder, so I looked at and tested a few scripts from google (and these boards) to no avail.
I have scriptrunner available, so there's got to be a way to make this happen with the tools at my disposal, but I'm lost. Any help would be nice. Thanks in advance.
I even tried creating a new field I would hide simply to convert the string to int, but can't seem to get anything to work.
To be clear:
1) Is there a way to have a selectable list saved as an integer?
2) How would I sum all values of customfield_25002 but only on issues matching something like :
project = TEST AND issuetype = Attendance AND "Occurrence Value?" in (0.25, 1.00) AND "Absence Date" >= -26w ORDER BY cf[21100] ASC, cf[25001] ASC, cf[25002] ASC, created DESC
Hi @Michael Sellner ,
welcome to the Atlassian community!
If I well understand your question, you need a way to sum values coming from differnt issues through a JQL. Please try the following plugin https://marketplace.atlassian.com/apps/1211625/sumup-for-jira?hosting=server&tab=overview
Hope this helps,
Fabio
I appreciate you! Thanks for the response.
Unfortunately, right now I am unable to pay for a license so I won't be able to use anything that's not free.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To transform a string into an integer, you can use Integer.parseInt(...). For example,
Integer.parseInt(issue.get("customfield_25002"))
But what I don't understand is where you want to display the sum of that field across multiple issues. JMCF calculated fields apply to individual issues, just like any Jira field. What you are looking for applies to a set of issues, and I don't see where you would display that value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, several places.
I was hoping in a JMCF custom field I could sum all of those custom fields that match a query like above, except it appears I left out the user picker, which is another field in the issue.
I also want to use it in custom scripting, if that same query above is above 4, send a notice, above 5 send a different notice, and at or above 6 yet another notice. I think I can figure that part out if I can get this JMCF field working properly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Michael Sellner ,
Custom fields are associated with issues. You cannot calculate a custom field value outside of the context of a single issue.
If you're trying to write a ScriptRunner script that will select issues using the jql query and then send an email based on these issues, you don't need a calculated field, you can run the calculation directly in the script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.