When i change the assignee using assign tab it will trigger with "ISSUE_ASSIGNED_ID" event. And also when i click assign to me it also trigger with "ISSUE_ASSIGNED_ID" event.
But when i changed assignee using the searchable text field which is in people panel it will trigger with "ISSUE_UPDATED_ID". But I changed the assignee. How can I catch that action when I changed assignee using that searchable text field.
I want to catch this event through my plugin.(Add-ons).
Jira version - 7.10.0
Nimesh,
You can access the request data on a listener that captures ISSUE_UPDATED event, an then check if it contains a value for the field assignee to trigger the action or not.
Definitely agreed, taking both events and checking for data when ISSUE_UPDATED is triggered is the simplest in my opinion. Will allow you to catch it even when other fields are updated!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry. I could not get your idea. How can i access request data in following code.
@EventListener
public void onIssueEvent(IssueEvent issueEvent) {
Long eventTypeId = issueEvent.getEventTypeId();
Issue issue = issueEvent.getIssue();
if (eventTypeId.equals(EventType.ISSUE_CREATED_ID)) {
MutableIssue issueObject = issueManager.getIssueObject(issue.getKey());
issueObject.setAssignee(ComponentAccessor.getUserManager().getUserByName("user3"));
issueManager.updateIssue(ComponentAccessor.getJiraAuthenticationContext().getUser(),
issueObject, EventDispatchOption.ISSUE_ASSIGNED, false);
log.info("Assignee : {}",issueObject.getAssigneeId());
} else if (eventTypeId.equals(EventType.ISSUE_RESOLVED_ID)) {
log.info("Issue {} has been resolved at {}.", issue.getKey(), issue.getResolutionDate());
} else if (eventTypeId.equals(EventType.ISSUE_CLOSED_ID)) {
log.info("Issue {} has been closed at {}.", issue.getKey(), issue.getUpdated());
}else if(eventTypeId.equals(EventType.ISSUE_ASSIGNED_ID)){
log.info("Uassigned {}",issue.getAssignee().getDisplayName());
}else if (eventTypeId.equals(EventType.ISSUE_UPDATED_ID)){
log.info("update assigned {}", issue.getAssignee().getDisplayName() );
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nimesh,
There is a good example here: https://community.atlassian.com/t5/Answers-Developer-Questions/issue-updated-event-contents/qaq-p/548180
The changelog will show all updated fields, if assignee is part of them, you can deduce the issue have been re-assigned :)
Hope this helps!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.