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

            We are impacted as well by this bug.

            It's really frustrating why a bug is not fixed after nearly 8 years, but maintenance model and price is increasing more and more.

            The suggested solution, to carry the issueId on the RemoteIssueLinkDeleteEvent is an absolute MUST. Otherwise the event seems totally useless to us.

            STill hoping to get this fixed in time.

            Klaus Foerschl added a comment - We are impacted as well by this bug. It's really frustrating why a bug is not fixed after nearly 8 years, but maintenance model and price is increasing more and more. The suggested solution, to carry the issueId on the RemoteIssueLinkDeleteEvent is an absolute MUST. Otherwise the event seems totally useless to us. STill hoping to get this fixed in time.

            Hi, I've given a task by my company, when an issue is created from confluence, I am asked to add title of confluence page to a custom field of the Jira issue. Due to this bug, I can neither access the issue nor remote link created when remotelinkcreatedevent is fired, since remotelink id is null within provided event. This is a serious bug preventing us from doing our work, please resolve it asap. We as company policy do not change source code of our bought products. Please just do the one line change provided in following page:

             

            https://community.atlassian.com/t5/Jira-Core-questions/RemoteIssueLinkCreateEvent-doesn-t-have-id-when-custom-jira/qaq-p/1321072

             

            many thanks.

            Yusuf TAMBAG added a comment - Hi, I've given a task by my company, when an issue is created from confluence, I am asked to add title of confluence page to a custom field of the Jira issue. Due to this bug, I can neither access the issue nor remote link created when remotelinkcreatedevent is fired, since remotelink id is null within provided event. This is a serious bug preventing us from doing our work, please resolve it asap. We as company policy do not change source code of our bought products. Please just do the one line change provided in following page:   https://community.atlassian.com/t5/Jira-Core-questions/RemoteIssueLinkCreateEvent-doesn-t-have-id-when-custom-jira/qaq-p/1321072   many thanks.

            JeffreyG added a comment -

            It's really frustrating that Igor proposed a fix when he filed this bug, but Atlassian has done nothing about it.

            JeffreyG added a comment - It's really frustrating that Igor proposed a fix when he filed this bug, but Atlassian has done nothing about it.

            Igor Baltiyskiy added a comment - - edited

            scott.geertgens, this is possible (and that's what I ended up doing) but still not great, because if I need issue ID, I need to use RemoteIssueLinkManager.findRemoteIssueLinksByGlobalIds() and then grab issue IDs from the members of the returned collection.

            Igor Baltiyskiy added a comment - - edited scott.geertgens , this is possible (and that's what I ended up doing) but still not great, because if I need issue ID, I need to use RemoteIssueLinkManager.findRemoteIssueLinksByGlobalIds() and then grab issue IDs from the members of the returned collection.

            For RemoteIssueCreateEvent, the problem can be mitigated by using getGlobalId() instead of getRemoteIssueLinkId(), as it does correctly return a value.

             
            The problem described with RemoteIssueLinkDeleteEvent is much more problematic with no way to capture the issue ID. Still an issue as of 7.1.7.

            Scott Geertgens added a comment - For RemoteIssueCreateEvent , the problem can be mitigated by using getGlobalId() instead of getRemoteIssueLinkId() , as it does correctly return a value.   The problem described with RemoteIssueLinkDeleteEvent is much more problematic with no way to capture the issue ID. Still an issue as of 7.1.7.

            Right, thanks — omitted the word from the summary.

            Igor Baltiyskiy added a comment - Right, thanks — omitted the word from the summary.

            MattS added a comment -

            This is for remote issue links, not regular issue links I guess?

            MattS added a comment - This is for remote issue links, not regular issue links I guess?

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

                Created:
                Updated: