I am trying to selectively reassign an issue based on the original reporter of the issue once the issue has been resolved. However, I'm missing something, obviously, because this simple script is not working--
if (issue.get("reporter").getUsername() == 'admin') {
issue.setAssignee('user_id')
} else {
issue.setAssignee(issue.get("reporter").getUsername())
}
We are using the option Set field value (JMWE add-on) and then choosing a value type of Groovy Expression.
Thanks in advance.
I think that setAssignee() expects a user object, and you're supplying a string. setAssigneeId() expects a string argument. For the first assignment I'd try issue.setAssigneeId('user_id'), and for the second I'd try issue.setAssignee(issue.get("reporter"))
Hope this helps,
Payne
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.