Work with threads in Jira Data Center

Good day!

I’m new in Jira Data Center plugin development on Java

I need to make some auto-transition after issue creation (depends on fields value)

Is any article about best practices about working with threads in JDC exist?
As i understand i must execute transition in another thread, in listener, or post-function

For example, in my task i use something like this:

Thread executorThread = new Thread(JiraThreadLocalUtils.wrap(() -> {
    try {
        log.debug("wait 1 second, so that running workflow transitions are finished ...");
    } catch (InterruptedException e) {

    issueUtils.transitionIssue(issue, 41, issueInputParameters);


Can i reach my aim WITHOUT 1 second waiting? More fancy?

When i’m use jql search, i write code like this:

try {

    searchResults = this.searchService.searchOverrideSecurity(user, query, PagerFilter.getUnlimitedFilter());
} catch (Exception exception) {
    log.error("failed to jql search, exception:\n{}", exception.getMessage());
} finally {

Have atlassian (or somebody) articles, documentation, examples about right way to develop Jira Data Center plugin?