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

There is no way to detect when remote issue link is created or deleted for a specific issue

      There is RemoteIssueLinkCreateEvent, but it doesn't have any information from which one can detect the issue for which the link was created. Specifically, there's RemoteIssueLinkCreateEvent.getRemoteIssueLinkId() which should return ID of the remote link that has been created. However, this method always returns null.

      Looking at the code, it's not surprising (DefaultRemoteIssueLinkManager.createRemoteIssueLink():

      RemoteIssueLink created = remoteIssueLinkStore.createRemoteIssueLink(remoteIssueLink);
      ...
      eventPublisher.publish(new RemoteIssueLinkCreateEvent(remoteIssueLink))
      

      The bug is in the second line: it's the original RemoteIssueLink object without ID that is passed to the event constructor (remoteIssueLink), not the one that was created and has the ID (created).


      Another story for RemoteIssueLinkDeletedEvent. Here, the getRemoteIssueLinkId() returns non-null ID of the deleted link. However, one cannot detect the issue from which the link was removed, because the link object no longer exists at this point!

      I'd suggest AbstractRemoteIssueLinkEvent objects to carry the whole RemoteIssueLink on board, or at least the issue ID. That would eliminate the described problems.

            [JRASERVER-45989] There is no way to detect when remote issue link is created or deleted for a specific issue

              Unassigned Unassigned
              ff5eced7cbfd Igor Baltiyskiy
              Affected customers:
              25 This affects my team
              Watchers:
              22 Start watching this issue

                Created:
                Updated: