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));

}
}

3 answers

1 accepted

0 votes
Answer accepted
Randall Fisher
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.
April 6, 2016

There does not seem to be a way to restrict the logging of work by date.

As a member of the Accounting team, once I have captured various CapX data from FY 2015, people can continue to log work into FY 2015.  (Too bad, so sad)

0 votes
Sadaf Jabin
August 30, 2018

Hi,

This can also be achieved using script listener. Please find the answer @ Restrict logging of work in the past

Cheers,

Sadaf Jabin

Hitesh_Goenka
May 28, 2020

What is script listener?

0 votes
Deleted user
January 11, 2016

You can disable "Logging Work" on certain issue statuses like "Closed" (jira.permission.work)

Reference: https://confluence.atlassian.com/jira/workflow-properties-189949.html

Randall Fisher
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.
January 11, 2016

I do not want to restrict the logging of work on an issue. I want to restrict logging dates on work prior to January 1, 2016.

Deleted user
January 11, 2016

What do you mean by "restrict logging dates"? Is it different from "restrict logging work on an issue"? Specifying a date range is not available with the JIRA workflow properties :(

Randall Fisher
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.
January 11, 2016

The values 12/31/2015, 12/30/2015, 12/29/2015, 12/28/2015, etc.

Suggest an answer

Log in or Sign up to answer