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 ...");
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }

    issueUtils.transitionIssue(issue, 41, issueInputParameters);
}));

executorThread.start();

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

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

try {
    ThreadLocalSearcherCache.startSearcherContext();

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

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