Creating a custom field of a custom field type

Hi Atlassian,

We have defined a custom field type in the manifest, and now we are trying to create a custom field of that custom field type programmatically.

To do so, we need to get the id of the custom field type, which has the following format: ari:cloud:ecosystem::extension/{app-id}/{installation-id}/static/{extension_key}
(as per https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#field-lifecycle)

If we create the custom field on a jira admin page, we can get this from the view context:

{
  localId: 'ari:cloud:ecosystem::extension/83****/f7****/static/jira-cloudforge-connector-admin-page',
  cloudId: 'c7****',
  moduleKey: 'jira-cloudforge-connector-admin-page',
  extension: { type: 'jira:adminPage' },
  installContext: 'ari:cloud:jira::site/c7****',
  accountId: '61****',
  license: undefined
}

with this, using the localId prop, we form the ID of the custom field type created in the manifest, as:

ari:cloud:ecosystem::extension/83****/f7****/static/<manifest key of custom field type>

and this works pretty well.

If we try to create it on app installation, however, we cant seem to get the right ids to form the custom field type id.

This is what we get from the post-install event:

{
   "id":"66****",
   "installerAccountId":"61****",
   "app":{
       "id":"83****",
       "version":"22.30.0"
    }
}

and from the context:

{"installContext":"ari:cloud:jira::site/c7***"}

We cant seem to be able to get the f7*** installation-id part needed to from the id. The app post-install lifecycle event has an ID which the docs say is the installation Id, but it is 66**** not f7***.

What are we missing?