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,457,001
Community Members
 
Community Events
176
Community Groups

Issue when trying to move to resolved status and the fix version is completed

Previously, I have an issue when trying to move to resolved status and the fixed versión was not set, it should show a message asking to complete fix versión.

 

Now, I am trying the other way around: having the fixed versión complete and trying to move to resolve status. 

It is supposed that I shouldn't have any issues, but when I click on Resolve button it shows me the following message:

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

 

The code that I have in the Validator in the transition is:

 

import java.util.Collection;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.project.version.Version;
import com.opensymphony.workflow.InvalidInputException;

//Collect<Version> fixVersions = $issue.getFixVersions();

if (! $issue.fixVersions) {
   throw new InvalidInputException("Fix Version/s is required");
}

 

What am I doing wrong? why is it showing that message? could you please help me?

 

Thanks in advance

Ro

1 answer

It should be enough adding this in a simple validator:

issue.getFixVersions() 

And then select the field fix versions to show the error you want there.

Hi Cristian!

 

I have written the exact what you told me, but now it doesn't show me the message error when the fix version is not complete.

 

I fogot to tell you that I am using Groovy

Are you using a simple validator or a scripted validator? Note that this are not the same. In Simple validator you don't need to use

throw new InvalidInputException("Fix Version/s is required");

But you ned to use it in a scripted validator

I am using Scripted Validator.

If you are using scripted validator use this:

import com.opensymphony.workflow.InvalidInputException

if (issue.getFixVersions()) {

throw new InvalidInputException("Fix Version/s is required");

}

If you are using Simple Validator, this should be enough:

issue.getFixVersions()

I do not have Script Runner installed (the company doesn't want to invest money on this) so I have installed Code Runner  Groovy, and I have written the code in my first post. But As I have said, when the fix version has a value then it shows the error "An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@17eedcdc: root cause: java.lang.NullPointerException"

I do not have Script Runner installed (the company doesn't want to invest money on this) so I have installed Code Runner  Groovy, and I have written the code in my first post. But As I have said, when the fix version has a value then it shows the error "An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@17eedcdc: root cause: java.lang.NullPointerException"

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events