You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.
Join groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
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
Harvey
Only ERROR level of "log" is logged by default. So
log.error(...)
function should work.
Or you need to setup logging level first using
log.setLevel(Level.DEBUG)
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.