Forums

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

Automation : Copy resolution

Mario GELES
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.
May 15, 2023

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 : 

Modifier le ticket
Erreur lors de la modification de tickets
SI-2005 (Spécifiez la Resolution (id or name) au format de chaîne (resolution)), SI-2006 (Spécifiez la Resolution (id or name) au format de chaîne (resolution)) 
Could someone help me please ? :)

1 answer

1 accepted

2 votes
Answer accepted
Gaston Valente
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.
June 22, 2018

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.

miikhy
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.
June 22, 2018

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

Nimesh Perera
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!
June 23, 2018
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() );

}
miikhy
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.
June 24, 2018

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

Suggest an answer

Log in or Sign up to answer