Simple Scripted Validator - Assignee is unassigned at time of transition

Bus Van Wagoner January 8, 2018

I would like to create a Transition Validator using the Simple Scripted Validator to check the Assignee field is blank or unassigned at the time of transition. It seems logical to me I could take the example provided "Assignee changed (Workflow functions only)"

issue.assignee != originalIssue.assignee

And change it to:

issue.assignee == NULL

But I get an error about NULL being an undeclared variable. 

Is there a simple 1 or 2 line way to do this?

I have other fields I would also like to verify the values of or verify they have or don't have a value when transitioning an issue. Would it be different for other types of fields?

3 answers

2 votes
Jenna Davis
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.
January 8, 2018

Hello, 

You should be able to do something like this in a simple scripted validator:

if(!issue.assignee){ return false }

Let me know if that works for you!

Jenna

Suzanne Seaton September 28, 2018

Jenna, this one worked for me, thanks!

issue.assignee == null did not work for some reason, but I'll quit fretting since yours did.

1 vote
Vijay Koleti May 13, 2020

Actually none of these worked for me. Below one worked:


issue.assigneeId != null || false
Hopper July 2, 2021

The previous answers are technically correct for the version of Jira at the time.  I have found that this is the correct solution for the Jira 8.x product.

0 votes
Bhushan Nagaraj
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 8, 2018

Have you tried issue.assignee == null ?

Bus Van Wagoner January 8, 2018

That worked!

Now I feel stupid.

Thanks for your help.

Bhushan Nagaraj
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 8, 2018

Happens with the best of the best :) Good luck. 

Sam February 8, 2018

Hi,

Can you please help me create a groovy script:

If Assignee field was changed from "Unassigned"

then

move an issue to "status name"

 

I'm trying to use "Fast-track transition an issue"

Events: Issue Assigned

Condition: I'm not sure 

Action: "status name"

 

issue.assignee == null is not working for me

issue.assignee != originalIssue.assignee - is working for me however it's working also if I change assignee from "someone" to "Unassigned" 

 

Thank you

Idiyana Binti Ahmad Salim January 18, 2024

Hi,

I'm not good with scripting. if let say the assignee field is not empty but the assignee is inactive user. how to write the script?

Suggest an answer

Log in or Sign up to answer