Using Scriptrunner, I defined a postfunction for a transition. In that transition a new issue is created and one of the linked issues of the source issue is set in the issue picker of the new issue.
Works fine.
But:
The above mentioned source issue itself is created by a transition of a third issue. And all issue links are set programmatically on creation.
Which still works fine.
However, in certain circumstances the mentioned source Issue should travel through the above mentioned transition directly after creation (using a FastTrack-Transition-Postfunction in the Create-Transition). In that situation, accessing the linked issues of the source issue fails and returns an empty list of issues.
So it looks to me like the setting of the linked issues during the creation of the source issue and accessing the linked issues happens in the same internal transaction, therefore the linked issues are not yet available.
So how can I tell Jira to first completely create the source issues (including its links to other issues), before starting on the transition of that source issue?
Or is there any other possibility for the root cause of this behaviour, that I overlooked?