Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

null pointer exception on validator using groovy

Good morning All!

 

Some weeks ago I have posted a question, and I have got some usefull answers but  I couldn't resolved a new issue that I have.

I have a Groovy validator on Resolved transition when I want to change to Resolved status. 

If fixed version is not populated it should show a message asking to enter a value for this field.

That issue is solved, but now if I have a value in the fixed version and try to transition to Resolved status it is showing a null pointer exception:

An unknown exception occured executing Validator
com.atlassian.jira.workflow.SkippableValidator@3eb359bf: root cause: java.lang.NullPointerException

 

This is the code I have for the validator on resolved transition:

import java.util.Collection;

import com.atlassian.jira.issue.Issue;

import com.atlassian.jira.project.version.Version;

import com.opensymphony.workflow.InvalidInputException;

 if (! $issue.getFixVersions().size()){
    throw new InvalidInputException("Se requiere ingresar Versión de Resolución")
}

What do you think it should be the problem? is there somthing missing? how can I solve it? 

 

thanks in advance,

 

Ro

 

1 answer

0 votes
Deleted user Dec 04, 2018

Hi @Rosana_Casilli

I'm just thinking out loud and might be completely wrong, but could your try changing the if statement to:

if($issue.getFixVersions().size() < 1) 

If that doesn't work, which add-on are you using to enter the validator in?

Kind regards
Jorden

Hi Jorden! it didn't work. 

I am using groovy code runner. 

the problem I have is when I populate the fixed version and try to transition to resolved status, I am getting the null pointer exception that I have pasted in the previous message. When I do not populate the fixed version is working fine.

Any suggestions?

 

thanks in advance

Ro

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Do Not Lose your Customer’s Trust

Missing deadlines is one of the biggest problems every team lead wants to avoid when dealing with managed services. When the customer contracts your company to help with IT services it is expected th...

24 views 0 0
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you