issues.each { issue ->
def assignee = issue.getAssignee()
def reporter = issue.getReporter()
def isAssigned = assignee != null
def isAssignedToTenable = assignee?.getUsername() == QUERY_USER_NAME // <-- Constant User
def assigneeChanges = changeHistoryManager.getChangeItemsForField(issue, "assignee")
def postCreationNonTenableAssignment = assigneeChanges.find{it.getTo() != null && it.getTo() != QUERY_USER_NAME}
def assignmentTime = postCreationNonTenableAssignment?.getCreated()
if (assigneeChanges.size() == 0) { // <-- Has not had an assignment change.
-- Do things --
else { // <-- Has had an assignment change.
def firstAssigneeChange = assigneeChanges[0]
if (!isAssignedToTenable && /* "actor = Sec-Eng team" --> How do I find the assignment actors? */ ) {
}
Anyone know how I can find the assignment actors for each issue? I can see who it's assigned to and from easily. But I'm missing something when it comes to finding the user whom initiated the action.
Hi @Michael Schultz,
Method getChangeItemsForField will return the type List<ChangeItemBean> and from the ChangeItemBean type you cannot retrieve the author name who performed the action.
For that you may use the method changeHistoryManager.getChangeHistories(Issue issue) and filter the history for assignee field change and then use changeHistory.getAuthorKey().
I have not tried it but may it help you.
Thanks,
Ram.
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.