At the moment, Issue Updated event is listened by a WebHook when:
- An issue is updated (Issue Updated) either in Edit Issue screen (clicking the Edit button) or in View Issue screen (inline-update)
- An issue is transitioned (Issue Transitioned)
If a WebHook is configured with a JQL, currently the JQL is checked when:
- For Issue Updated, after the issue is updated
- For Issue Transitioned, when the transition button is clicked, or before the post-functions are executed
This causes some confusion and/or unexpected behaviors, and some requirements can't be achieved.
- Create a Select List custom field named Counter with 2 options: One and Two
- Add the field to a Transition screen and all Create/Edit/View Issue screens of project ABC
- Create a WebHook with this configuration:
- Events: Issue Updated only
- Create an issue ABC-1 and ensure its Counter value is not Two
- Edit the field Counter either inline or in Edit Issue screen for ABC-1 -> Set its value to Two
The WebHook is triggered as expected.
- Edit the field Counter either inline or in Edit Issue screen for ABC-1 -> Set its value to One (or None)
The WebHook is not triggered.
- When Counter is not Two, transition ABC-1 and set Counter to Two on the transition screen -> Complete the transition
The WebHook is not triggered as expected.
- When Counter is Two, transition ABC-1 and set Counter to One (or None) on the transition screen -> Complete the transition
The WebHook is triggered.
- This behavior not only applies to a Select List custom field, but also to other fields if they're updated on a Transition screen. Known related issues are:
- For Status: JRASERVER-65174 - Webhook is not triggered correctly when the JQL is describing a specific status.
- For Status (different JQL): JRACLOUD-65293 - Transition doesn't trigger webhook if JQL contains 'updated after' with relative time
- For Assignee: JRASERVER-62919 - Webhook based on JQL would not trigger when used in Workflow Post Functions
- This behavior can't be worked around using WebHook Post-function. For example, if the WebHook is added to the post-function list of the Transition, it's not fired either (following Scenario 2), regardless of the order of the post-function.
One may expect that, if the WebHook Post-function is after the Issue Re-index Post-function, the WebHook should be triggered.