Custom Field Type Namespace

Hey guys,

We’ve joined a couple of Jira plugins we were developing into a single one, and we’ve hit an issue with the custom fields namespacing =/

Like in Active Objects, we want to force the namespace key identifier to preserve and use the same data we have in the already running environments, like so

    <ao namespace="" key="ao-module">
        <description>The module configuring the Active Objects service used by this plugin</description>

The plugin-key is now for resources - So, if we’d leave the namespace attribute out of the configuration, when installed in an already running environment, the current plugin configuration would not find the AO resources that were deployed previously, and we’d loose access to old data.

We want to do the same for the custom fields, since some of them were defined in the plugins we’ve joined now

    <customfield-type namespace="" name="Custom Tag" i18n-name-key="" key="custom-tag-cf"
        <description key="custom-tag-cf.description">Custom Tag Field</description>
        <resource name="view" type="velocity" location="templates/custom-tag.vm"/>
        <resource name="edit" type="velocity" location="templates/custom-tag.vm"/>
        <valid-searcher package="${atlassian.plugin.key}.subprojecta" key="custom-tag-searcher"/>

Main changes we thought would make it work are

  • namespace=“”
  • package="${atlassian.plugin.key}.subprojecta"

But when we log the on plugin install listener, we get this custom field type key:

Custom field key:, Custom Tag Field

Any help on how to force it would be appreciated - Also, we have access to database to migrate the data, just don’t know were to start :slight_smile:

Thanks in advance

For those who stumble with this issue, we’ve dealt with it through a SQL Script to update the PUBLIC.CUSTOMFIELDVALUE entries, for those custom fields.

Our solution for postgresql was something like

DO $$
		oldrow record;
		newrow record;
		cfvrow record;
		-- Find all old core fields on DB 
		FOR oldrow IN
			SELECT * FROM public.customfield where public.customfield.customfieldtypekey LIKE '%subprojecta%'
			RAISE NOTICE '% - %', oldrow.customfieldtypekey, oldrow.cfname;
			-- Find all new tcm fields on DB 
			FOR newrow IN
				SELECT * FROM public.customfield where public.customfield.customfieldtypekey LIKE ''
				IF newrow.cfname = oldrow.cfname THEN
					RAISE NOTICE '% - %', newrow.customfieldtypekey, newrow.cfname;
					FOR cfvrow IN
						SELECT * FROM public.customfieldvalue where public.customfieldvalue.customfield = OR public.customfieldvalue.customfield =
						RAISE NOTICE 'Found value % - issue %, cf %',, cfvrow.issue, newrow.cfname;
						RAISE NOTICE 'old % - new %',,;
						UPDATE public.customfieldvalue SET customfield = WHERE id =;
						RAISE NOTICE 'updated: %',;
					END LOOP;
				END IF;

This was run through psql cli, remotely, with servers stopped and with previous DB backup. Gladly, it worked for our environments :grinning:

Hope this help anyone