Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-47661

Custom fields are cached as null

    XMLWordPrintable

Details

    Description

      We have recently discovered a bug in JIRA that is affecting our add-on directly and can even lead to loss of information.

      This problem is related with custom fields and how are they cached by JIRA. Upon startup (PluginEnabledEvent) our add-on installs multiple custom fields. It matches those custom fields by ID as we store this ID the first time a custom field is created.

      JIRA caches all custom field objects as they are accessed but, if the Custom Field Type is not available, JIRA still caches these custom fields as CacheObject.NULL. All the following requests for a custom field in these conditions will return null.

      Some add-ons, will load all custom fields upon startup (e.g PluginEnabledEvent) using, for instance, the method CustomFieldManager#getCustomFieldObjects().

      If one of these add-ons is enabled before our add-on, it will cache all our custom fields as NULL. Hence, when our add-on is enabled, the custom fields searched by ID return NULL leading the add-on to install them again, creating duplicated custom fields.

      This behaviour only applies when JIRA is restarted.

      We have found that this problem is affecting other add-ons as well that, just like us, are checking if their custom fields are installed using the ID.

      Our current fix is clearing the custom fields cache when the add-on is enabled.

      Hope this get's fixed ASAP. Thank you.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              0da34dec2336 Bruno Conde
              Votes:
              13 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated: