Say on a Post Function list I have 3 different scripts that do different things based on different execution conditionals, and would ideally be kept separately due to their use elsewhere in the system (if someone commits to the master backups its more work to merge into one megascript)
Lets call these Scripts A, B and C (in that order in the Post Function operation list)
- Are they guaranteed to execute in that order (A->B->C)?
- Will B execute before A is finished? Can/should B rely on possible changes made by A or assume randomness?
- If B was to Transition an issue (thereby triggering other automation on a different Post Function routine) will C be run? If C was to run, will it fail due to outdated Transition data passed to the script?
The joys of an async environment
Hi Andrew,
The short answer is no. You can't rely on any ordering for post functions and scripts will be executed in parallel. JIRA fires off the webhooks that cause the scripts to be executed in the order they appear in, but it does not wait for the webhook to complete before sending the next.
We have some ideas around guaranteed ordering of post functions, such as having a list of scripts that execute as one post function, but nothing concrete as yet.
Regards, Jon
So;
Are they guaranteed to execute in that order (A->B->C)? => Yes, JIRA respects the Post Function ordering
Will B execute before A is finished? Can/should B rely on possible changes made by A or assume randomness? => No; guarantees aren't there. Assume unreliable states if multiple scripts are modifying the same fields
If B was to Transition an issue (thereby triggering other automation on a different Post Function routine) will C be run? If C was to run, will it fail due to outdated Transition data passed to the script? => Yes, C will be run as its part of the Post Function op routine. Again assume unreliable states
Correct? Its basically what I expected, but good to confirm.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this also true for script listeners? That is, they run in parallel?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Andrew: Yes if I understand correctly your scenario you're correct.
Aristedes: Yes they are run in parallel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.