Forums

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

Assigning a automatic user to the issue using Script runner in Escalation Services

Raj April 15, 2019

Hi Everyone,

I need a script which helps in assigning a defined user(User will be written in script) automatically to a issue.

Using Script Runner in Escalation Services.

Thanks in Advance

1 answer

1 accepted

0 votes
Answer accepted
Antoine Berry
Community Champion
April 15, 2019
Raj April 15, 2019

Hi @Antoine Berry , 

Thanks for the response.

i tried this code in the provided link earlier, but its not working to assign a assignee automatically using escalation services.

Can you please try to provide a code which can help me in executing this.

Antoine Berry
Community Champion
April 16, 2019

Hi @Raj ,

I tried the code I found in this thread, with adding the imports, and it worked : 

import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption

def user = ComponentAccessor.getUserManager().getUserByKey("berry_a")
MutableIssue mutableIssue = ComponentAccessor.getIssueManager().getIssueByCurrentKey(issue.getKey());
mutableIssue.setAssignee(user);
def issueManager = ComponentAccessor.getIssueManager();
issueManager.updateIssue(user, mutableIssue,EventDispatchOption.ISSUE_ASSIGNED, true);

image.png

Antoine

Like Raj likes this
Raj April 16, 2019

@Antoine Berry Thanks a lot for your script. it working as expected.

Like Antoine Berry likes this

Suggest an answer

Log in or Sign up to answer