# Using EntityLinkService

**URL:** <https://community.developer.atlassian.com/t/using-entitylinkservice/17504>\
**Category:** Jira Server\
**Created:** [April 17, 2018, 6:55pm UTC](https://community.developer.atlassian.com/t/using-entitylinkservice/17504 "2018-04-17T18:55:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathieu.yargeau](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mathieu.yargeau](https://community.developer.atlassian.com/u/mathieu.yargeau)\
**Post date:** [April 17, 2018, 6:55pm UTC](https://community.developer.atlassian.com/t/using-entitylinkservice/17504/1 "2018-04-17T18:55:25Z")

</div>

I am trying to create a link between a Jira Project and a Confluence Space.

> JiraApplicationLinkService jals = ((JiraApplicationLinkService) ComponentAccessor.getComponent(JiraApplicationLinkService.class));  
> ApplicationLink confluenceLink = jals.getPrimaryApplicationLink(ConfluenceApplicationType.class);  
> DefaultTypeAccessor ta = new DefaultTypeAccessor(ComponentAccessor.getPluginAccessor(), ComponentAccessor.getPluginEventManager());
> 
> MutatingEntityLinkService els = ((MutatingEntityLinkService) ComponentAccessor.getComponent(MutatingEntityLinkService.class));  
> EntityLinkBuilderFactory entityLinkBuilderFactory = els.getEntityLinkBuilderFactory();
> 
> EntityLink link = entityLinkBuilderFactory.builder().key(“NEW”).name(“NEW”).type(ta.getEntityType(ConfluenceSpaceEntityType.class)).primary(true).applicationLink(confluenceLink).build();
> 
> els.addEntityLink(createdProject.getKey(), JiraProjectEntityType.class, link);

The problem is that the MutatingEntityLinkService (interface for DefaultEntityLinkService) is null. I am able to get the simple EntityLinkService and fetch the existing entityLink, but that interface does not allow to create a new EntityLink. Is there a way to fetch the EntityLinkService that allows for EntityLink creation?

---

<div class="post-metadata">

**Author:** ![mathieu.yargeau](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@mathieu.yargeau](https://community.developer.atlassian.com/u/mathieu.yargeau)\
**Post date:** [April 18, 2018, 6:56pm UTC](https://community.developer.atlassian.com/t/using-entitylinkservice/17504/2 "2018-04-18T18:56:52Z")

</div>

I found a way to do it using the private REST API “/rest/applinks/1.0/entitylink/{type}/{key}”. However, I wish there was another way…
