Issue Summary
In Jira service management issue events are processed asynchronously by maintaining a list of events in a queue. But when issue events are generated by a background process, it is calculated directly on the same thread without being queued. This can result in a race condition where a new issue event gets processed before all the existing events are processed.
Steps to Reproduce
- Create a sample SLA - "Time to in progress" which begins counting when "Entered Status: Open" and stops on "Entered Status: Work in progress".
- Create an automation rule in Automation for Jira plugin. When - Issue created, Then - Transition to "Work in progress".
- Create requests using a script and notice SLAs are not calculated on some of the issues.
Expected Results
SLAs are correctly calculated for all issues.
Actual Results
SLAs are not calculated for all issues. There is no error in the log file.
Workaround
For issues due to automation for Jira plugin - Using automation provided by JSM instead of automation for Jira plugin will result in correct SLAs.
For all other plugins/async action issues - Disable asynchronous processing by adding the following feature flags. (Note disabling asynchronous processing will increase time taken for user actions.)
- sd.internal.base.off.thread.on.completion.events.disabled
- sd.internal.bounded.off.thread.on.completion.events.disabled
More details on how to enable/disable a feature flag can be found here - Enable Dark Feature in Jira