Custom field with id ‘customfield_ID’ does not exist

If ever you browse to a project’s settings to change the notification scheme, you might bump into a stack trace; resulting in you to not being able to change the notification scheme for that project, or other projects that share this same notification scheme. This guide will show you how to resolve this issue.

Stack Trace

Cause:
java.lang.IllegalArgumentException: Custom field with id 'customfield_10034' does not exist.
Stack Trace: [hide]
java.lang.IllegalArgumentException: Custom field with id 'customfield_10034' does not exist.
at com.atlassian.jira.issue.fields.DefaultFieldManager.getCustomField(DefaultFieldManager.java:674)
at com.atlassian.jira.notification.type.UserCFValue.getArgumentDisplay(UserCFValue.java:196)
at com.atlassian.jira.projectconfig.contextproviders.ProjectNotificationContextProvider.getNotifications(ProjectNotificationContextProvider.java:179)
at com.atlassian.jira.projectconfig.contextproviders.ProjectNotificationContextProvider.getContextMap(ProjectNotificationContextProvider.java:102)
at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.initContextMap(CacheableContextProviderDecorator.java:70)
at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.getContextMap(CacheableContextProviderDecorator.java:46)
at com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor$ContextAwareWebPanel.getHtml(DefaultWebPanelModuleDescriptor.java:143)
at com.atlassian.jira.projectconfig.tab.WebPanelTab.getTab(WebPanelTab.java:75)
at com.atlassian.jira.projectconfig.servlet.PanelServlet.outputTab(PanelServlet.java:163)
at com.atlassian.jira.projectconfig.servlet.PanelServlet.doGet(PanelServlet.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at com.atlassian.plugin.servlet.DelegatingPluginServlet.service(DelegatingPluginServlet.java:42)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:52)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...

Do note that customfield_10034 is the ID of the problematic custom field. It could be any value apart from 10034.


Possible Cause(s)

One of the most probable occurrence of this issue is when you are migrating your JIRA instance from one location to the next, but do not have the specific custom field in the new instance yet. In natural cases, it is possible to specify a custom field to the notification scheme (an example of this is when you would like to notify a group of users based on the custom field itself).


Resolution(s)

  1. Find whether the custom field really is missing (via the database):
    select * from customfield where id = 10034;
    

    If the result came out to zero, then the custom field is indeed missing:

    id | customfieldtypekey | customfieldsearcherkey | cfname | description | defaultvalue | fieldtype | project | issuetype
    ----+--------------------+------------------------+--------+-------------+--------------+-----------+---------+-----------
    (0 rows)
    
  2. Find related notifications referring to the said custom field:
    select * from notification where notif_parameter = 'customfield_10034';
    

    This query would return a lot of notifications types:

    id   | scheme | event | event_type_id | template_id |       notif_type        |  notif_parameter
    -------+--------+-------+---------------+-------------+-------------------------+-------------------
    10051 |  10000 |       |             2 |             | User_Custom_Field_Value | customfield_10034
    10052 |  10000 |       |             3 |             | User_Custom_Field_Value | customfield_10034
    10053 |  10000 |       |             4 |             | User_Custom_Field_Value | customfield_10034
    10050 |  10000 |       |             1 |             | User_Custom_Field_Value | customfield_10034
    10054 |  10000 |       |             5 |             | User_Custom_Field_Value | customfield_10034
    10055 |  10000 |       |             6 |             | User_Custom_Field_Value | customfield_10034
    10057 |  10000 |       |             7 |             | User_Custom_Field_Value | customfield_10034
    10056 |  10000 |       |            14 |             | User_Custom_Field_Value | customfield_10034
    10058 |  10000 |       |             8 |             | User_Custom_Field_Value | customfield_10034
    10059 |  10000 |       |             9 |             | User_Custom_Field_Value | customfield_10034
    10061 |  10000 |       |            11 |             | User_Custom_Field_Value | customfield_10034
    10060 |  10000 |       |            10 |             | User_Custom_Field_Value | customfield_10034
    10063 |  10000 |       |            15 |             | User_Custom_Field_Value | customfield_10034
    10062 |  10000 |       |            12 |             | User_Custom_Field_Value | customfield_10034
    10065 |  10000 |       |            13 |             | User_Custom_Field_Value | customfield_10034
    10064 |  10000 |       |            16 |             | User_Custom_Field_Value | customfield_10034
    10263 |  10021 |       |             3 |             | User_Custom_Field_Value | customfield_10034
    10265 |  10021 |       |             2 |             | User_Custom_Field_Value | customfield_10034
    10268 |  10021 |       |            14 |             | User_Custom_Field_Value | customfield_10034
    10274 |  10021 |       |            12 |             | User_Custom_Field_Value | customfield_10034
    10269 |  10021 |       |             7 |             | User_Custom_Field_Value | customfield_10034
    10262 |  10021 |       |             1 |             | User_Custom_Field_Value | customfield_10034
    10272 |  10021 |       |            10 |             | User_Custom_Field_Value | customfield_10034
    10267 |  10021 |       |             5 |             | User_Custom_Field_Value | customfield_10034
    10266 |  10021 |       |             6 |             | User_Custom_Field_Value | customfield_10034
    10276 |  10021 |       |            16 |             | User_Custom_Field_Value | customfield_10034
    10271 |  10021 |       |             9 |             | User_Custom_Field_Value | customfield_10034
    10277 |  10021 |       |            13 |             | User_Custom_Field_Value | customfield_10034
    10273 |  10021 |       |            11 |             | User_Custom_Field_Value | customfield_10034
    10275 |  10021 |       |            15 |             | User_Custom_Field_Value | customfield_10034
    10264 |  10021 |       |             4 |             | User_Custom_Field_Value | customfield_10034
    10270 |  10021 |       |             8 |             | User_Custom_Field_Value | customfield_10034
    11006 |  10021 |       |            17 |             | User_Custom_Field_Value | customfield_10034
    11031 |  10000 |       |            17 |             | User_Custom_Field_Value | customfield_10034
    (34 rows)
    
  3. Confirm which notification schemes are these notifications attached to. Use the values in the scheme column in the previous SQL query:
    select * from notificationscheme where id = 10000 OR id = 10021;
    

    You’ll get a list of notification schemes:

    id   |                   name                    | description
    -------+-------------------------------------------+-------------
    10000 | Default Notification Scheme               |
    10021 | [LS] AIRlog - Default Notification Scheme |
    (2 rows)
    
  4. Delete notifications with the problematic custom field:
    DELETE from notification where notif_parameter = 'customfield_10034';
    
  5. Restart JIRA.

Technology Consultant at ServiceRocket. Great knowledge in Atlassian JIRA. Blogger. Programmer. Anime Vector Artist.