Discover Jira Cloud products
Learn more about Jira Cloud products, features, plans, and migration.
Having a large number of custom fields can make viewing, searching, and creating issues slower. By reducing the number of custom fields on your site, you’ll make Jira faster and more responsive. Here are different ways to reduce the number of custom fields.
You must be a Jira admin to delete custom fields.
To delete an unused custom field:
Go to Settings () > Issues.
Under Fields, select Custom fields.
Find custom fields that you don’t need. The Screens and contexts and Projects columns show you where a field is used, and the Last used column shows the last time the field was updated.
For every unused custom field, select ··· > Move to trash.
To restore a custom field, go to the Trashed tab.
Too many options on custom fields of the Select list (single choice) and Select list (multiple choices) type can also slow down creating, editing, and viewing issues.
Tip: Combine custom fields with similar options
If you have custom fields with a similar option list, combining them into a single field can help you delete more unnecessary fields.
If it suits your field, you can change the Select list field to a text field and document the possible values somewhere. To do this, create a custom field and run the Python script below. This Python script uses this Jira REST API specification.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
from jira_client import ApiClient
# Configuration is ambiguous
from jira_client.configuration import Configuration as ApiConfiguration
from jira_client.rest import ApiException
from jira_client import IssuesApi, IssueFieldsApi
from pprint import pprint
configuration = ApiConfiguration()
configuration.username = 'brodie@example.com'
configuration.password = '[my app token]'
configuration.host = 'https://mycompany.atlassian.net'
# Turn on debug output if needed
#configuration.debug = True
configuration.debug = False
# Issue keys we want to update
issue_key_arr = [
'JPY3-1',
'JPY3-2'
]
api_client = ApiClient(configuration)
# Find the field keys for the fields we are interested in
from_field_name = 'Product Selection'
# Single select field
from_field_type = 'com.atlassian.jira.plugin.system.customfieldtypes:select'
from_field_key = None
to_field_name = 'Product'
# Text select field
to_field_type = 'com.atlassian.jira.plugin.system.customfieldtypes:textfield'
to_field_key = None
issue_fields_api = IssueFieldsApi(api_client)
# Find the "from" field
fields = issue_fields_api.get_fields_paginated(start_at=0, max_results=5, query=from_field_name)
if fields.total > 0:
for this_field in fields.values:
if (this_field.name == from_field_name) and (this_field.schema.custom == from_field_type):
from_field_key = this_field.id
print(f"Found the from field id={from_field_key}")
break
# Find the "to" field
fields = issue_fields_api.get_fields_paginated(start_at=0, max_results=5, query=to_field_name)
if fields.total > 0:
for this_field in fields.values:
if (this_field.name == to_field_name) and (this_field.schema.custom == to_field_type):
to_field_key = this_field.id
print(f"Found the to field id={to_field_key}")
break
if from_field_key == None:
raise ValueError('The "from" field could not be found')
if to_field_key == None:
raise ValueError('The "to" field could not be found')
for issue_key in issue_key_arr:
print(f"Processing issue {issue_key}")
try:
issue = issues_api.get_issue(issue_key)
except ApiException as api_exception:
if api_exception.status == 404:
print(f"Issue {issue_key} not found")
else:
# TODO: Handle 429 nicely
raise api_exception
else:
print(f"For issue {issue_key}, id={issue.id}")
issue_fields = issue.fields
from_field_value = issue_fields[from_field_key]['value']
to_field_value = issue_fields[to_field_key]
print(f"Before: From value=\"{from_field_value}\", To value=\"{to_field_value}\"")
if from_field_value != None and to_field_value == None:
print("Updating To value for issue {issue_key}")
issue_fields = {}
issue_fields[to_field_key] = from_field_value
issue_body = {
"fields": issue_fields
}
issues_api.edit_issue(issue_body, issue.id)
print(f"Updated issue {issue_key} successfully")
else:
print(f"Value does not need to be updated for issue {issue_key}")
Tip: Use a workflow validator with the text field
Add a workflow validator to check that your text field is an acceptable value. Learn more about configuring workflow validators.
Was this helpful?