I understand that running a JQL like issueFunction in lastCommented("inGroup support") isn't possible via Script Runner, so I'm trying to extract the user which made the last comment with Scripted Fields and save it into the User Picker template.
I'm using the following code snippet to extract the user
def lastCommenter = ComponentAccessor.getUserUtil().getUserObject(ComponentManager.getComponentInstanceOfType(CommentManager.class).getComments(issue).last().author);
2 problems with this:
- If indeed I chose the User Picker template, then the value that is returned to the ticket (under users section) is Anonymous.
- If I use the Text Field template, I get the user + number like so: user.name:1000
Can you suggest a way to either extract the the tickets that had their last comment by a user from a specific group or a way to return the current value via Groovy?
Thanks