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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,269
Community Members
 
Community Events
175
Community Groups

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

Atlassian Community Events