Clear Field Configuration
If you came here through a direct link, you may want to check the main JAUS page first!
Clear Field Configuration is a Userscript that allow Admins to hide all fields from a Field Configuration that’s currently not in use. It can also show all fields instead (like a panic rollback :)).
Download/installation URL:
Use cases
Keeping Field Configurations with as minimum fields as possible is a known best-practice to prevent performance degradation (specially during re-index). See https://confluence.atlassian.com/clean/clean-up-your-jira-instance-1018788592.html (and the Advanced cleanup).
Whenever a custom field’s created it’s automatically added to all Field Configurations — and there’s no easy or quick way to “clear” a Field Configuration to the bare minimum fields.
This Userscript’s meant to help Admins create a new “Empty” Field Configuration that they may further copy, add the required fields for each Project and assign to each respectively.
New Custom Fields will continue to be automatically included into every existing Field Configuration. Admins will need to keep up with this continuous house-keeping, but the kick-off (ie. hiding all already created custom fields) is something this Userscript helps with.
Scope
The Userscript works on the “ConfigureFieldLayout” admin screen on both Cloud and Server/DC:
The Userscript tries to prevent it’s execution on Field Configurations currently in use. It does that by looking for certain UI elements in the screen that shows “used by … projects”.
If it finds such elements, it’ll print a message in the console log saying it detected the Field Config’s in use and thus not injected the JAUS button and feature.
In case this checks fails or returns a false-negative, there’s a hard-coded warning to make sure the Field Config’s not currently in use. If happens nonetheless, you can quickly run it again and choose the “Show all fields” option.
Usage
On the Configuration screen for a Field Configuration, if it’s not currently in use by a Project, the JAUS button should show up.
Press the JAUS button on the top or the access key “u” to bring up the Clear Field Configuration screen.
Simple choose if you want to “Hide all fields” or “Show all fields” and press the Commit! button.
The Userscript will hide the button to prevent multiple clicks and fire all necessary requests in the background. As soon as all requests finish, the page will automatically reload and you’ll see all fields have either been hidden or brought back.
The script doesn’t mess with Locked or System fields — it literally scans for only the available links in the page (the same ones you’re seeing as “Hide” and “Show”) and simulates a click on each.
Mechanics
This Userscript doesn’t use the REST API. It fires requests to links present ion the screen.
The script looks for the header elements to inject the JAUS button and also if there’s any text in the page that suggests the Field Config’s in use
If there’s any
<em>
tag with contents either like "shared" or "used"If there’s any element with style class “shared-by”
If there’s any element with style class “used-by”
It then scans the page itself for every HTML link element
<a>
with theid
attribute starting with "hide_" or "show_".It sequentially fires one request to each links fetched.
When the last request finishes, the page automatically reloads.
Repository
JAUS Clear Field Configuration’s source code is hosted in BitBucket:
Notice that to download/install we advise the /raw/
URL.
Authorship
JAUS Bulk Edit Request Participant was designed and implemented by Rodrigo Martinez (Linkedin profile).
It's licensed under Creative Commons Attribution-ShareAlike 4.0 International License.
Support
If you have questions, any problem or need instructions on this Userscript’s usage, please open a request in the JAUS Help Portal.
Please select the Component jaus-clear-field-configuration
.
Roadmap
…
Known issues
Please submit them through JAUS Help Portal!
Jira feature request
Please vote, watch and comment on these feature requests (for both DC and Cloud)!
JSWSERVER-20070 - Hide new custom fields in already existing custom field configurations
JRASERVER-44161 - To be able to hide custom field by default in field configuration
JRACLOUD-44161 - To be able to hide custom field by default in field configuration
Even though resolved as “duplicate” or “won’t do”, Atlassian may reconsider it under users' requests!