Hi Community,
I have made an automation to close the linked issues of the trigger issue when this one is closed.
I want the linked issues have the same resolution than the trigger issue. So I used the set issue action, I selected the resolution field and the "Copy" option.
But it doesn't work.
This is the error log :
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.