I noticed that there are still a few tickets that are now assigned to employees who have since left the company.
We would like to have an automation for this which, say, checks every 24 hours whether the assignee of a ticket (all types) in our project is inactive and in this case removes the assignee again, the ticket should remain in the assigned team
Is this possible and how ?
thanks
This case be done for free with Jira Automation
Trigger: On Schedule (Set cron up how you would like)
# We want to look in a specific project. Check that the resolution is empty so we only include current cases in our search and assignee is 'in' the inactiveUsers() function which is pulling from the users database of jira
Trigger JQL: project = {INSERT YOUR PROJECT} AND resolution is EMPTY AND assignee in inactiveUsers()
Then: Assign Issue {INSERT WHO EVER YOU WOULD LIKE TO ASSIGN THESE CASES TO}
Yes this is possible with scriprunner.
You can use either an escalation service job or a custom job.
With the escalation service, you can specify the JQL to find those tickets right in the job definition form. For example:
assignee in inactiveUsers() and resolution is empty
The trick with the escalation job is that you'll have to leave the Action blank which means don't perform any workflow actions.
And since you are not performing any transition, you can't use the examples that leverage the issueInputParameters variable that's provided in the Additional Issue Actions script.
But you can still write your own script that will call the issueService and set the Assignee to "unassigned".
Maybe something like this:
import com.atlassian.jira.component.ComponentAccessor
def issueService = ComponentAccessor.issueService
def validationResult = issueService.validateAssign(currentUser, issue.id, null)
if(validationResult.isValid()){
issueService.assign(currentUser, validationResult)
} else {
log.error validationResult.errorCollection*.errorMessages.join('\n')
}
I can't test it because my system doesn't allow issues to be unassigned. So I'm a little unsure about the "null" part.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.