Rule execution trace made easy
Since Automation for Jira version 8.0.5, there is more information logged in the DEBUG level to easily trace event caused rule execution.
Setup
There are just three log categories that must be set up with the DEBUG level to have trace information available:
- com.codebarrel.jira.plugin.automation.event - the category provides logs related to Jira event handling in A4J
- com.codebarrel.jira.plugin.automation.queue - the category provides logs related to asynchronous rule execution supported by queue
- com.codebarrel.automation.api.service - the category provides logs related to every rule execution
Find more information on setting up the logging level in this knowledge base article.
Below you can find an example automation rule that was used to demonstrate how A4J handles Jira events and executes rules:
The rule simply reacts to the issue created event and adds new comment under newly created issue.
Captured log
Here is the output captured from the main Jira log file when an issue was created in the project named SCRUM. The captured data was trimmed to have just 60 lines to make it easier to analyze. Some unimportant lines that appeared in the middle of the relevant payload were also removed. There were also additional three automation rules in the system that shouldn't react to the issue created. The log contains information how they are ignored.
No | Content | Comment |
---|---|---|
1 | 2022-10-13 09:31:51,705+0200 Received Jira issue event bundle: | A4J built-in event listener is informed about new issue related event. |
2 | 2022-10-13 09:31:51,705+0200 Rule registry received issue event bundle: | The captured event |
3 | 2022-10-13 09:31:51,705+0200 Rule registry has extracted 1 event(s) from bundle. | Event handler in the rule registry extracted exactly one issue related event |
4 | 2022-10-13 09:31:51,705+0200 Rule registry is handling issue event: | Here is information about details of the event being handled. |
5 | 2022-10-13 09:31:51,711+0200 Received generic event : | A4J Jira event listener is working in the other threads as well, |
6 | 2022-10-13 09:31:51,711+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | Another entry related to PerformanceEvent captured above |
7 | 2022-10-13 09:31:51,722+0200 Rule registry executeEventRules init: | Here goes important information |
8 | 2022-10-13 09:31:51,722+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | This information says that there are no rules configured with 3rd party triggers |
9 | 2022-10-13 09:31:51,732+0200 Submitting AutomationEvent 'jira:issue_created:issue_created' | The Jira Event is transformed into Automation Event and submitted to |
10 | 2022-10-13 09:31:51,736+0200 Started processing queue item: QueueItemBean{ | Automation executor thread ('automation-rule-executor:thread-5') |
11 | 2022-10-13 09:31:51,736+0200 Async executor is processing AutomationEvent | Here is meaningfull information that the same |
12 | 2022-10-13 09:31:51,737+0200 Async executor found 3 rules for AutomationEvent | Automation executor performs final matching |
13 | 2022-10-13 09:31:51,739+0200 Component can not handle: | First rule rule starts with trigger 'on issue commented' |
14 | 2022-10-13 09:31:51,740+0200 Async executor postponed execution of Rule(id=4, name='comment to audit log') | Automation thread ignored the rule above. |
15 | 2022-10-13 09:31:51,742+0200 Component can not handle: ComponentTypeKey{ | Second rule starts with trigger 'on field value changed' |
16 | 2022-10-13 09:31:51,742+0200 Async executor postponed execution | Automation thread ignored the rule above. |
17 | 2022-10-13 09:31:51,748+0200 Rule execution 'Global rule for Issue created' (rule ID [2], audit ID [7]) | Third rule satisfies the Automation event, the this rule will be executed. |
18 | 2022-10-13 09:31:51,748+0200 Started executing component jira.issue.event.trigger:created. | 'Global rule for Issue created' execution starts. |
19 | 2022-10-13 09:31:51,759+0200 | Execution of trigger component - this is just pass through execution. |
20 | 2022-10-13 09:31:51,759+0200 Started executing component jira.issue.comment. | Start of execution of 'Add comment to issue' action. |
21 | 2022-10-13 09:31:51,769+0200 Received generic event : | Now the A4J event listener receives nested Jira event that was raised after |
22 | 2022-10-13 09:31:51,769+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | Derived event handling (matched by 'automation-rule-executor:thread-5') |
23 | 2022-10-13 09:31:51,769+0200 Received generic event : | Derived event capture (matched by 'automation-rule-executor:thread-5') |
24 | 2022-10-13 09:31:51,769+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | Derived event handling (matched by 'automation-rule-executor:thread-5') |
25 | 2022-10-13 09:31:51,769+0200 Received generic event : | Derived event capture (matched by 'automation-rule-executor:thread-5') |
26 | 2022-10-13 09:31:51,770+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | Derived event handling (matched by 'automation-rule-executor:thread-5') |
27 | 2022-10-13 09:31:51,771+0200 Received generic event : | Derived event capture (matched by 'automation-rule-executor:thread-5') |
28 | 2022-10-13 09:31:51,771+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | Derived event handling (matched by 'automation-rule-executor:thread-5') |
29 | 2022-10-13 09:31:51,771+0200 | Derived event capture (matched by 'automation-rule-executor:thread-5') |
30 | 2022-10-13 09:31:51,771+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | Derived event handling (matched by 'automation-rule-executor:thread-5') |
31 | 2022-10-13 09:31:51,771+0200 Received generic event : | Derived event capture (matched by 'automation-rule-executor:thread-5') |
32 | 2022-10-13 09:31:51,772+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | Derived event handling (matched by 'automation-rule-executor:thread-5') |
33 | 2022-10-13 09:31:51,772+0200 Received Jira issue event bundle: | Derived event capture (matched by 'automation-rule-executor:thread-5') |
34 | 2022-10-13 09:31:51,772+0200 | Derived event handling (matched by 'automation-rule-executor:thread-5') |
35 | 2022-10-13 09:31:51,772+0200 | The event bundle being handled provides one issue related event. |
36 | 2022-10-13 09:31:51,772+0200 Rule registry is handling issue event: | The event says that issue SCRUM-2 was commented. |
37 | 2022-10-13 09:31:51,772+0200 Rule registry executeEventRules init: | The nested traceId is generated for this event |
38 | 2022-10-13 09:31:51,772+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | No third party rules found for the nested event. |
39 | 2022-10-13 09:31:51,778+0200 Received generic event : | In the meantime A4J Jira event listener is working |
40 | 2022-10-13 09:31:51,778+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | The same context as above but the handler does its job. |
41 | 2022-10-13 09:31:51,781+0200 Submitting AutomationEvent 'jira:issue_updated:issue_commented' | This is the event serializer job for the nested event |
42 | 2022-10-13 09:31:51,782+0200 Received generic event : | In the meantime A4J Jira event listener is working |
43 | 2022-10-13 09:31:51,782+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | The same context as above but the handler does its job. |
44 | 2022-10-13 09:31:51,785+0200 Started processing queue item: QueueItemBean{ | Automation executor thread ('automation-rule-executor:thread-6') |
45 | 2022-10-13 09:31:51,785+0200 Async executor is processing AutomationEvent | This is strict information that the executor is dealing with the |
46 | 2022-10-13 09:31:51,786+0200 Async executor found 3 rules for AutomationEvent | Executor reads rules for final matching ad will analyse them. |
47 | 2022-10-13 09:31:51,788+0200 Ignoring event 'EVENT:jira:issue_updated:issue_commented' | Execution is ignored because A4J knows that the event is nested. |
48 | 2022-10-13 09:31:51,788+0200 Async executor postponed execution of Rule(id=4, name='comment to audit log') | The rule trigger doesn't fit the Automation Event type. |
49 | 2022-10-13 09:31:51,792+0200 Component can not handle: ComponentTypeKey{ | The rule trigger doesn't fit the Automation Event type. |
50 | 2022-10-13 09:31:51,792+0200 Async executor postponed execution of | The rule trigger doesn't fit the Automation Event type. |
51 | 2022-10-13 09:31:51,793+0200 Component can not handle: ComponentTypeKey{ | The rule trigger doesn't fit the Automation Event type. |
52 | 2022-10-13 09:31:51,793+0200 Async executor postponed execution of | The rule trigger doesn't fit the Automation Event type. |
53 | 2022-10-13 09:31:51,794+0200 Resolving queue item (in 9ms): QueueItemBean{ | Automation executor thread ends the job for the nested event. |
54 | 2022-10-13 09:31:51,810+0200 Received Jira issue property set event : | Here the additional info from the initial event executor |
55 | 2022-10-13 09:31:51,810+0200 Rule registry received issue property event: | Same as above but from handler's job. |
56 | 2022-10-13 09:31:51,810+0200 Rule registry executeEventRules init: | Same as above but from handler's job. |
57 | 2022-10-13 09:31:51,810+0200 Rule registry handleEventWithThirdPartyTriggers init: 0 3rd party rules found | Same as above but from handler's job. |
58 | 2022-10-13 09:31:51,811+0200 Completed executing component jira.issue.comment. | Finish of execution of 'Add comment to issue' action |
59 | 2022-10-13 09:31:51,812+0200 Rule execution 'Global rule for Issue created' (rule ID [2], audit ID [7]) | Finish of rule execution. |
60 | 2022-10-13 09:31:51,820+0200 | Automation executor finished the job for initial Automation Event. |
Event flow across automation threads