Hi everyoneI trying to get comment id on EventType.ISSUE_COMMENT_DELETED_ID but i got null. Does it exist another way to get id?
Thanks
JIRA erases everything from a deleted issue. I suspect it does the same thing for comments. where did you get the location from?
It's code in my @EventListener:
I don't use listener, but I'd verify that event actually happens in the listener documentation for the level of JIRA you're on. I could be that the comment is being deleted while the listener is firing and the ID is now set to null.
Yes, i think the same. But mb you know how it's possible to get comment id?Mb it is possible to obtain actions log?
I don't. However, why are you trying to get it? when the comment is deleted it is gone. Are you trying to copy it somewhere?
Yes i have copy in active objects.
I develop plugin for synchronization jira and third-party service by api. I have jira_comment_id - my_service_comment_id link. I can make api request on that service and process them but it will be too long.
I'm trying to find another solution using atlassian sdk.
I found an answer here. That answer is particular to ScriptRunner, so I'm converting to regular Java for plugins in my answer here.
@EventListenerpublic void handleCommentDeleted(IssueEvent event) { if (!EventType.ISSUE_COMMENT_DELETED_ID.equals(event.getEventTypeId())) { return; } Comment comment = (Comment) event.getParams().get("originalcomment"); log.info("Comment: {}", comment);}
I must say, it is an almost inexplicable design choice to have `issueEvent.getComment()` return null and requiring this parameter casting business instead.
It looks like you're new here. Sign in or register to get started.