I've been trying to wrap my head around this. We have a custom single line text field that our users enter data into. This data would like to be used in a statistical view. My understanding is the only way to do this is to have this custom field add each value as a option in a drop down custom field. How would one go about automating this? I've read thru the groovy documentation and just can't seem to figure this one out, does someone have a script they could share to do this?
customfield_710 text add entered value as option to customfield_810 drop down
Thanks in advance.
Yes, that's right, to do stats, you need fields that can be indexed from a list of options.
I've done what I think you want a couple of times in the past - specifically setting up a Jira project that was for admins to track all the work, and change, on their Atlassian applications, and we did obvious stuff like "request project from template, authorise, automatically create", but also "this field's list of options is maintained by people updating a Jira issue" - stuff like "add new option please, fill in a text field with new name, click ok, and a post-function adds the option"
There's two things you'll need to look at if you do it that way.
First, there's the actual option - the starting point there is the OptionsManager class - it's the main thing that handles options, and has calls like createOption, getAllOptions and so-on.
Second, you'll need to consider permissions. In my example, it was not Administrators running the post-function, so my script needed to take on the role of an admin while it was trying to call the createOption function.
I've not seen any recent examples (my code was for Jira 3, and long since forgotten which old disk I might have kept a copy on), but the Java API is over at https://docs.atlassian.com/software/jira/docs/api/8.13.13/ - use frames and the left-bar to find OptionsManager docs
Thanks was hoping someone had an example we could work with rather than reinventing the wheel. Thank you.
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.