Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

RemoteIssueLinkCreateEvent doesn't have id when custom jira listener catches it

Dmitrii
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 9, 2020

Hi Community,

Could you please help with issue below? Did you face this problem?

Now we are implementing custom listener for our system, listener must catch moments when user create/delete remote issue links on local server and noticed that object of RemoteIssueLinkCreateEvent doesn't have id when listener catches it. We suppose this is a bug, but we didn't find bug ticket for this.

Also we noticed that jira has another such event RemoteIssueLinkUICreateEvent and it's working well, because RemoteIssueLinkCreateEvent has id and we can work with this. But we cannot use it because it works just in case user creates remote link by jira UI, so such way cannot catch moment when user creates remote links by rest api http://localhost:8080/rest/api/latest/issue/TEST-1018/remotelink .

We use JIRA server with version: 8.2.1

Below you can find an example how we test of catching such events:

public class RemoteIssueLinksListener extends AbstractIssueEventListener
{

private final RemoteIssueLinkManager remoteIssueLinkManager;

public RemoteIssueLinksListener(RemoteIssueLinkManager remoteIssueLinkManager, JiraAuthenticationContext jiraAuthenticationContext)
{
this.remoteIssueLinkManager = remoteIssueLinkManager;
this.jiraAuthenticationContext = jiraAuthenticationContext;
}

@EventListener
public void onCreateRemoteIssueLinkEvent(RemoteIssueLinkCreateEvent remoteIssueLinkCreateEvent)
{
LOG.error("Create - TEST");
LOG.error("Create -: "+ remoteIssueLinkCreateEvent.getRemoteIssueLinkId());
LOG.error("Create -: "+ remoteIssueLinkCreateEvent.getGlobalId());

LOG.error("TEST: "+ (remoteIssueLinkManager == null));
Long id = remoteIssueLinkCreateEvent.getRemoteIssueLinkId();
LOG.error("id: "+ id);

RemoteIssueLink remoteIssueLink = remoteIssueLinkManager.getRemoteIssueLink(id);
LOG.error("Link: "+ (remoteIssueLink == null));
}

@EventListener
public void onCreateUiRemoteIssueLinkEvent(RemoteIssueLinkUICreateEvent remoteIssueLinkUiCreateEvent) {
LOG.error("Create UI - TEST");
LOG.error("Create UI -: "+ remoteIssueLinkUiCreateEvent.getRemoteIssueLinkId());
LOG.error("Create UI-: "+ remoteIssueLinkUiCreateEvent.getGlobalId());

LOG.error("TEST: UI"+ (remoteIssueLinkManager == null));
Long id = remoteIssueLinkUiCreateEvent.getRemoteIssueLinkId();
LOG.error("id: "+ id);

RemoteIssueLink remoteIssueLink = remoteIssueLinkManager.getRemoteIssueLink(id);
LOG.error("Link: "+ (remoteIssueLink == null));

}
}

4 answers

1 accepted

0 votes
Answer accepted
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 14, 2013
0 votes
Timothy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 14, 2013

Try and manually copy the attachments folder from the old JIRA_HOME folder to the new JIRA_HOME folder.

0 votes
Vartika Garg
August 14, 2013

I found the attachement folder in zip file but how to I manually put it into new Jira. Can you write down the steps?

0 votes
Vartika Garg
August 14, 2013

where can I find the home folder?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events