How do I set the Assignee field to "Unassigned" when an issue status transitions to Closed or Abandoned?

Hugh Prior
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2012

I want all my issues which transition to Closed or Abandoned status to be assigned the user "Unassigned", since it doesn't seem to make sense to have a user assigned something where there is nothing left to do.

In "Add Post Function To Transition" I have, among others:

  • Assign to User

    BUT:

    JIRA does not let me specify "Unassigned" as a user name in the "Assign to User" field since this is not a real user name.

  • Clear Field Value

    BUT:

    JIRA does not seem to clear the Assignee field if I specify to clear it when the transition happens (maybe Clear Field Value only applies to text/numeric fields).

Any ideas?

I have a kludge which would work which is to create an artificial "mister.nobody" user and then use the "Assign to User" to do it, but I hate kludges.

6 answers

3 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2012

Frankly, the assignee is to be left as the person who actually resolved the issue. Mostly otherwise, while looking up history data, you may land up in a state that you need to click and open each issue to find who resolved it. And also leaving the assignee with the actual user helps to dig out your completed statistics based on assignee which is useful in many ways.

I know I didn't answer your question, but was trying to explain the rationale behind the default workflow.

Clearing of the field as a post-condition of course works for Assignee too. Have you enabled 'Allow Unassigned Issues' in your System settings?

Hugh Prior
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2012

"Allow unassigned Events" is set to ON; this is what I see in the Admin settings and it is possible to manually assign an event to "Unassigned". Maybe it's a bug with version 3.13.3 (I know it's old but we're still in places on Internet Explorer 6. Yes, I know).

I think based on Renjith V argument, we will leave things as they are.

Thanks for your help.

Ivar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2012

We actually added an additional Resolved By field for our workflow as an issue is Resolved by a developer, but usually closed by the QA's after successful verification.

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2012

So you used the "Last Resolution User" custom field available at https://plugins.atlassian.com/plugin/details/5139?

2 votes
Muhammad Akram Sharifi February 5, 2018

go to workflow Edit work flow click on done transition and post functions add new post function 

chose update issue field 

issue field set it to assignee

field value Unassiged 

click add and publish workflow. 

1 vote
Sufian Reiter October 24, 2016

The main point is often that you also need to store your value in the database:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
def issueManager = ComponentAccessor.getIssueManager();
MutableIssue mutableIssue = issueManager.getIssueObject(issue.id)
    mutableIssue.setAssignee(null);
    mutableIssue.store();
Jamil Rahimov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2018

It didn't work.

0 votes
Ignacio Pulgar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 13, 2015

If you just want to find all unassigned issues through a JQL, excluding already closed issues:

assignee in (EMPTY) AND statusCategory != Done
0 votes
Tanja July 20, 2015

Make sure you do not have other post functions that conflicts with the this one. To make sure create a new transition and add the post function that clears the assignee.

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2012

Clear Field Value should work for Assignee as well. Are you sure the 'Allow UnAssigned' option is enabled? Also, what is the behavior when you add this? Does it changes assignee to a different user or the assignee remains the same?

Hugh Prior
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2012

I am sure allow unassigned option is enabled:

  • I can manually assign an assignee to "Unassigned" without any problem
  • In Administration --> General Configuration I see "Allow unassigned Events ON"

The assignee stays the same.

I have tested it doing auto-assign to a different role member or a specific user and that works

Suggest an answer

Log in or Sign up to answer