Question Goal: To have one script that contains a bunch of helper and query methods, each with various parameter input needs, that can be used to specific data (depending on the input need) and being able to call these methods from within some other script. Currently, the script is being stored in a Scriptrunner custom Script field because we don't know where else to put it. Also, we don't know if there's any way to pass in input to a custom script field or if it's possible to call a method in this scripted field from within another scripted field, so that we can avoid copying the same 200 lines script over and over again to new custom fields. In testing scripted fields, you can pass in an Issue Key through the GUI.
Ultimate Goal: Using Xporter, to be able to export various data values found within, referenced by, or linked to one or more issues.
Example: For a particular Fix Version on a project, automatically query for all Tasks/Defects/etc issues of that version, total up the number of issues returned, and export that total value to one cell in an Excel spreadsheet. Additionally and more complex, also grab a custom field SLOC value from each of these query-resulting issues, total all of those custom field values up, and also exporting that value to a single cell within the Excel spreadsheet.
It sounds like you want some utility methods available across different scripts.
For this you need to place your utility class in the script roots. See the example in the docs here: https://scriptrunner.adaptavist.com/latest/jira/#_script_roots
Hope this helps.
Yes, we could copy this class script over and over and put the entire thing into 1+ custom fields that each have their own specific hardcoded purpose like one to return the total of this and one to return the total of that. But instead, it'd be more efficient to have a main header script of sorts that we can plug in whatever new value we desire and have the method class script that holds all of the logic.
If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot