Offlate we have created a lot of custom fields and some of them are duplicates and less use to non use fields.
We would like to have an option to export all the custom fields in an excel and validate them and clean up unwanted/unused custom fields.
Thanks
Thulasiraman N.
Hi @Thulasiraman Nagarajan , I couldn't find an out-of-the-box way to export a list of all the custom fields in Jira or JSM, so I asked The Clinic Doctor, @Bryan Guffey for help in their weekly Atlassian Clinic session (you join the event and ask them whatever you need help with, they'll help you figure it out!). They looked at using Atlassian Command Line Interface (ACLI) but it wasn't applicable, so they suggested the following Python script:
import requests
import csv
# Jira instance details
JIRA_URL = "https://your-domain.atlassian.net"
API_ENDPOINT = "/rest/api/3/field"
USERNAME = "your-email@example.com"
API_TOKEN = "your-api-token"
# Set up authentication and headers
auth = (USERNAME, API_TOKEN)
headers = {
"Accept": "application/json"
}
# Fetch all fields
response = requests.get(JIRA_URL + API_ENDPOINT, auth=auth, headers=headers)
response.raise_for_status()
fields = response.json()
# Filter custom fields
custom_fields = [f for f in fields if f['custom']]
# Write to CSV
with open('jira_custom_fields.csv', 'w', newline='', encoding='utf-8') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(['ID', 'Name', 'Type', 'Searchable', 'Orderable'])
for field in custom_fields:
writer.writerow([
field.get('id'),
field.get('name'),
field.get('schema', {}).get('custom'),
field.get('searchable'),
field.get('orderable')
])
print("Exported custom fields to jira_custom_fields.csv")
# ----------- END ----------
Give that a try and let us know if it works.
First, you dont need to export them, simply go to cog wheel on the upper left corner -> Work-items-> Fields
From there, you can see if a custom field is in use by space or scheme, if its not in use - you can remove it.
Best regards,
Ariel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @arielei
We have about 800 custom fields and added into many spaces. However, most of the custom fields do not have values in it. So, if I have an option to export all of them, we can validate and delete them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.