field required if assignee is not unassigned

Kathleen Jacobs September 30, 2013

I have fast track setup, so if there is an assignee, goes to another status.

But It's being blocked by that the new status requires a field, where it's not requered when the ticket is created.

Is there a way, when creating a ticket, to make a field required if thier is an asignee?

Tryig it with a script Validator but now sure what to put. Since issue/Assignee is only filled after i hit "create issue"

1 answer

1 accepted

0 votes
Answer accepted
Darly Senecal-Baptiste
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.
September 30, 2013

Hi kjacobs,

At the transition,

  1. Go to the validators
  2. Select the Script Validator
  3. Click on Simple scripted validator
  4. At the condition field, you can add the following script

import com.atlassian.jira.ComponentManager;


def componentManager = ComponentManager.getInstance();
def customFieldManager = componentManager.getCustomFieldManager();


def cassignee = issue.getAssignee() //or user = issue.assginee

def cfield = customFieldManager.getCustomFieldObjectByName("customfield")

def cfieldv = issue.getCustomFieldValue(cfield);

def passesCondition = false;
if (cassaginee != null && cfieldv != null)
{
  passesCondition = true;
}

5. Error line, Type the error text you want.

6. At the field, select the field you are planning to set

Kathleen Jacobs September 30, 2013

I added this on the "Create" validator

It worked when I had a user in the assignee field, but but i have unassigned in the assignee field, it did not.

As I create the issue, i only want it to require a field if the asignee field is not unassigned.

Normal Path:

Create -> Open -> Dev

Going from Open to Dev adds a requirement of Resolution. If I fast track from Create to Dev, it wont work because Resolution is not filled in and does not even get the user the option to fill it in, or tell them it's even required.

Wanted Path:

If Assignee is not unassigned

Prompts user to fill in Required field Resolution

Create -> Dev

If Assignee is Unassigned

Create -> Open

Darly Senecal-Baptiste
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.
October 1, 2013

The assignee value "Unasigned" means that the assignee value is null.

Also, Create status does not hold two tranistions, It must this way Create > Open > Dev.

Suggest an answer

Log in or Sign up to answer