Description
Summary
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.
Scenario / Steps to reproduce
- 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:
- JQL:
project = ABC and Counter = Two
- Events: Issue Updated only
- JQL:
- Create an issue ABC-1 and ensure its Counter value is not Two
Scenario 1 - Issue Updated
- 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.
Scenario 2 - Issue Transitioned (the opposite behavior)
- 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 makes it impossible to achieve this requirement:
- Fire the WebHook only when ABC-1 is transitioned and its Counter value is set to Two from a different value that doesn't match the WebHook JQL at the time of clicking the transition button.
Notes
- 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.
Attachments
Issue Links
- relates to
-
JRASERVER-59735 WebHook not showing JQL for Post Function based WebHooks
- Gathering Impact
- supersedes
-
JRACLOUD-65293 Transition doesn't trigger webhook if JQL contains 'updated after' with relative time
- Closed
-
JRASERVER-62919 Webhook based on JQL would not trigger when used in Workflow Post Functions
- Gathering Impact
-
JRASERVER-65174 Webhook is not triggered correctly when the JQL is describing a specific status.
- Gathering Impact