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

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 can I get a list of failing validators before doing transition programmatically? Edited

I'm writing scripted listener to automatically transition parent issue to in progress, when any of the child issues goes in progress.

I use IssueService.validateTransition() method to validate the transition before it is actually executed by a call to IssueService.transition() method.

The problem is that IssueService.validateTransition() method checks only for unsatisfied permissions and conditions. It does not check for failing validators. API allows to do only a single thing about that - I can use TransitionOptions instance passed to IssueService.validateTransition() method to skip validators during transition:

TransitionOptions transitionOptions = new TransitionOptions.Builder().skipValidators().build()

...which is a nice shortcut but does not solve the problem in this particular case as requirements are two:

1) Transition the parent anyway even if validators are not satisfied.

2) Send a notification to parent issue assignee and reporter, about obligatory data missing in the issue (means about failing validators).

Not using TransitionOptions to skip checking validators, results in a rollback exception raised that can't be caught in the listener's code (as it is raised AFTER the listener is executed) and the child issue that triggered the listener execution is not allowed by JIRA to enter 'In Progress' status (reverted back?). Apart from the main topic I must say it is extremely strange that a listener is executed within the same transaction with event-triggering transition. Everybody would expect listener's execution to be a completely separate process from the transition that triggered the event.

Given that my questions are:

- Is it possible to catch rollback exception raised AFTER IssueService.transition() is executed?

- How can I get all the failing validators BEFORE calling IssueService.transition() method?

- Why IssueService.validateTransition() does not check for validators?

 

Please do not send me back to https://jira.atlassian.com/browse/JRACLOUD-65928 or to https://jira.atlassian.com/browse/JRA-44681 as those are about post-functions not the listener and do not answer this topic. 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

Share your Confluence Cloud experience for a chance to win $500!

Take our 5-minute survey to win a $500 Visa gift card! Are you currently using Confluence Cloud? We want to hear from you! Fill out this quick survey about your Confluence Cloud experience so we ...

75 views 1 4
Read article

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