Forums

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

Identify user who did transition in Script Runner custom email

Megan Makowiecka
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!
July 16, 2018

I'm working on a custom email to be sent when an issue uses a specific transition and I have that email setup to contain some custom information.

I can't seem to get the name of the user who actually triggered the transition.

Can anyone help me with configuring this to pull in the user that did the transition?

Thanks in advanced!

 

Below is the simple script I have created to display in HTML. 

<p><strong>Link to issue: </strong><a href = "${baseurl}/browse/${issue.getKey()}">${issue.getKey()}</a></td></tr><br /><strong>User who triggered transition: </strong><span style="color: #0000ff;">USER GOES HERE</span>
<hr />
<p><strong>Summary:</strong> ${issue.summary}<br /><strong>Reporter:</strong> ${issue.reporter.name}<br /><strong>Assignee:</strong> ${issue.assignee.name}<br /><strong>Account:&nbsp;</strong>${issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Account"))}<br /><strong>Description:</strong> ${issue.description}</p>
<hr />
<p>
<% if (mostRecentComment)
out << "<strong>Last comment: </strong>" << mostRecentComment
%>
</p>

1 answer

1 accepted

0 votes
Answer accepted
Mark Markov
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 Leaders.
July 17, 2018

Hello @Megan Makowiecka

You can do it like this

<p><strong>Link to issue: </strong><a href = "${baseurl}/browse/${issue.getKey()}">${issue.getKey()}</a></td></tr><br /><strong>User who triggered transition: </strong><span style="color: #0000ff;">${currentUser.getDisplayName()}</span>
<hr />
<p><strong>Summary:</strong> ${issue.summary}<br /><strong>Reporter:</strong> ${issue.reporter.name}<br /><strong>Assignee:</strong> ${issue.assignee.name}<br /><strong>Account:&nbsp;</strong>${issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Account"))}<br /><strong>Description:</strong> ${issue.description}</p>
<hr />
<p>
<% if (mostRecentComment)
out << "<strong>Last comment: </strong>" << mostRecentComment
%>
</p>

Suggest an answer

Log in or Sign up to answer