Prerequisites

Create the custom field

See here for specifics. Your atlassian-plugin.xml should end up looking something like this:
[cc lang=”xml”] xmlns=”http://www.atlassian.com/schema/plugins”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://www.atlassian.com/schema/plugins
http://schema.atlassian.com/jira/jira-4.3.xsd”>

${project.description}
${project.version}

A field for referencing issues from another Jira server.

[/cc]

Component import

We need to get a reference to the API services, so that we can invoke them. I’m going to use the EntityLinkService, to link to projects on other Jira servers. Add the following to atlassian-plugin.xml:

[cc lang=”xml”][/cc]

If you want to learn more about Component Import plugin modules, see here.

The code

The external issue field is basically a text field, so I can reuse some functionality by extending the StringCFType class. Since we have the component import of the EntityLinkService, it will get automatically injected if we have it as a constructor parameter.