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,414,438
Community Members
 
Community Events
170
Community Groups

How to raise an "InvalidInputException" in a Custom listener

I want to do an automatic validation check on some fields when creating/updating an issue.

I created an custom listener, selected the relevant projects and events.

However in this simplified script:

import com.opensymphony.workflow.InvalidInputException
throw new InvalidInputException("Input not valid")

crashes with the following error message:

2018-05-17 10:03:44,565 DEBUG [runner.WithPluginCompilationCustomiser]: Compile Script15.groovy, to node: Script15
2018-05-17 10:03:44,565 DEBUG [runner.WithPluginCompilationCustomiser]: Compile Script15.groovy, to node: Script15
2018-05-17 10:03:44,831 ERROR [runner.AbstractScriptListener]: *************************************************************************************
2018-05-17 10:03:44,831 ERROR [runner.AbstractScriptListener]: *************************************************************************************
2018-05-17 10:03:44,831 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: <inline script>
[InvalidInputException: [Error map: [{}]] [Error list: [[Input not valid]]]
	at Script15.run(Script15.groovy:7)
2018-05-17 10:03:44,831 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: <inline script>
[InvalidInputException: [Error map: [{}]] [Error list: [[Input not valid]]]
	at Script15.run(Script15.groovy:7)

Scriptrunner 5.3.26
Jira: 7.5.3

1 answer

1 accepted

4 votes
Answer accepted

Your listener is correctly throwing the exception. That is the error you see in the console.

Hi @Roland Holban (Adaptavist)

How to show this exception on jira UI ? 

I am writing similar code above but the exception is not being shown on ui when i perform issue updated event

Like Teja likes this

@Roland Holban (Adaptavist) Any answer for this legit question.

@Ronand Holban

answer please.

@Quinton Lephoto  

You can find answer here.

- Tejas

Like Quinton Lephoto likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events