Looking to see if anyone has any thoughts on a possibility to have a script that runs periodically and looks for open issues assigned to inactive users (disabled) and then it re-assigns to either a default use or project lead for specific project set within the script. The script could be run manually/automatically and could also be scripted to run against certain project(s).
We are looking to help our projects leads/admin get more visibility on open issues assigned to users that are no longer with company.
I would use a scriptrunner escalation service for this and combine it with inactiveUsers() JQL function.
Something like this:
Because we're using none, we can't use the issueParameters. We have to code the complete update:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.util.ImportUtils
import com.atlassian.jira.issue.index.IssueIndexingService
def issueIndexingService = ComponentAccessor.getComponent(IssueIndexingService.class)
//current user will be the runas parameter
def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
//static user
def user = ComponentAccessor.userManager.getUserByName('p6s')
//project lead
//def user = issue.projectObject.projectLead
//set the new assignee
issue.setAssignee(user)
//store the value
ComponentAccessor.issueManager.updateIssue(currentUser,issue,
//re-index the issue
EventDispatchOption.DO_NOT_DISPATCH,false)
def wasIndexing = ImportUtils.isIndexIssues()
ImportUtils.setIndexIssues(true)
issueIndexingService.reIndex(issue)
ImportUtils.setIndexIssues(wasIndexing)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.