Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

How to get Error Messages/Output (SCRIPTRUNNER)

The situation I have is as follow:

I need to wipe out the fields in a behavior when a new dropdown is selected. The problem is whenever I click create button and an error exist on the form it is wiping out the fields for some reason, even though I am checking for "getFieldsChanged()". I just figured at this point, an easy workaround is to check for any errors that would be returned and if some errors are returned, I'll just build an exception where the clear fields function is called. I have no idea how to get the error returned though... Is anyone able to provide me syntax on how to do this? This is what I've got going so far but the list is empty.


def jiraServiceContext = new JiraServiceContextImpl(user, new SimpleErrorCollection())

def errorList = jiraServiceContext.getErrorCollection()

log.debug(errorList.dump()) // currently outputting {}


Much appreciated


1 answer

Only ERROR level of "log" is logged by default. So


function should work.

Or you need to setup logging level first using


as described here

I have no issue outputting logs. Before I run my script I do

log.debug("START SCRIPT") 

which output no problem. But I need to catch errors returned on a create submission that fire back off because of validation results, read and interpret those results to help the user with the next time they try to hit the create button. I am doing this by refining the choices in the checkbox list.

Hi @Harvey Bennett , oh, ok, I understand now. But unfortunatelly I never tried to get errors this way. But I think that any "error collection" is filled in with data when Validators are executed and validators are executed when transition is executed. So you would need to validate validators any time the fields on the screen are changed.

I remember we used this method to validate transition

So it might help a little, but it will be still quite complicated code.

Suggest an answer

Log in or Sign up to answer

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