You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a010f6a
Browse filesBrowse the repository at this point in the historyBrowse files
<Tip>**Plan requirement**: This feature requires an On-call Standard or higher subscription. [Learn more](https://flashcat.cloud/flashduty/price/)</Tip>
8
8
9
-
Use the Jenkins [Notification plugin](https://plugins.jenkins.io/notification/) to sync job builds to Flashduty On-call. Each build becomes one Flashduty change; every phase of the build, from queued and started to finished, updates that same change.
9
+
Use the Jenkins [Notification plugin](https://plugins.jenkins.io/notification/) to sync job builds to Flashduty On-call. Each build becomes one Flashduty change; the build's start and finish update that same change.
10
10
11
11
Jenkins cannot tell whether a build changed anything, so add the notification only to **jobs that deploy**, not to jobs that only compile or test.
12
12
@@ -36,15 +36,17 @@ Go to **Manage Jenkins → System** and make sure **Jenkins URL** under **Jenkin
36
36
37
37
Go to **Manage Jenkins → Plugins → Available plugins**, search for **Notification**, and install it. You need Jenkins administrator permission.
38
38
39
+
The plugin also needs the **JUnit** plugin, which Jenkins does not install with it. If **Manage Jenkins → Plugins → Installed plugins** does not list JUnit, install it too. Without JUnit, no notification is sent and the build log shows `NoClassDefFoundError: hudson/tasks/test/AbstractTestResultAction`.
40
+
39
41
</Step>
40
42
41
43
<Steptitle="Add the endpoint to a deployment job">
42
44
43
45
1. Open the deployment job, click **Configure**, find the **Job Notifications** section, and click **Add Endpoint**
44
46
2.**Format**: select `JSON`
45
47
3.**Protocol**: select `HTTP`
46
-
4.**Event**: select `All Events`, so Flashduty sees the whole build: queued, started, and finished
47
-
5.**URL Source**: select `Plain Text` and paste the complete Flashduty integration Push URL into **URL**. To keep the URL out of the job configuration, select `Credentials Store` instead, save the Push URL as a Secret text credential, and reference its ID
48
+
4.**Event**: select `All Events`, so Flashduty sees the build both start and finish
49
+
5.**URL Source**: select `Credentials Store`, save the complete Flashduty integration Push URL as a **Secret text** credential, and select that credential in **URL**. With `Plain Text`, the plugin prints the full Push URL, including `integration_key`, in the log of every build
48
50
6. Keep **Branch** at the default `.*`, leave the other options at their defaults, and click **Save**
49
51
50
52
If the job configuration is managed by a Jenkinsfile (for example, a multibranch pipeline), add the same settings to the Jenkinsfile's `properties`. You can generate the code on the pipeline's **Pipeline Syntax → Snippet Generator** page by selecting `properties: Set job properties`.
@@ -73,7 +75,6 @@ Each build is one change. Its change key (change_key) is `<full build URL>#<queu
73
75
74
76
| Build phase (phase) | Build result (status) | Flashduty change status |
75
77
|---|---|---|
76
-
| QUEUED | — | Ready |
77
78
| STARTED | — | Processing |
78
79
| COMPLETED, FINALIZED | SUCCESS | Done |
79
80
| COMPLETED, FINALIZED | UNSTABLE | Done |
@@ -84,6 +85,8 @@ Done, Failed, and Canceled are end states; Flashduty records the change's end ti
84
85
85
86
UNSTABLE means every build step ran, but tests or quality checks reported problems, so it is recorded as Done; use the `result` label to filter these changes.
86
87
88
+
The plugin sends QUEUED only when the build starts, never while the build waits in the queue. Flashduty accepts QUEUED without recording it, so a change appears when its build starts.
89
+
87
90
A `notifyEndpoints` step in a pipeline with `phase` set to `NONE` is accepted without creating a change.
88
91
89
92
## Change content
@@ -106,7 +109,7 @@ Labels can be used in routes and to filter the change list:
106
109
|`phase`| The latest build phase |
107
110
|`result`| The build result, present once the build has finished |
108
111
109
-
`branch` and `commit`appear only in notifications sent after the build checks out code, not in the queued and started phases. Route on `job`; otherwise the early and late events of one build can land in different channels.
112
+
`branch` and `commit`are sent only by freestyle jobs that use Git under **Source Code Management**. A Pipeline job that checks out with the `git` step does not send them. A notification sent when the build starts can carry the values from before this build's checkout, so rely on the values at the end of the build. Route on `job`; otherwise the early and late events of one build can land in different channels.
110
113
111
114
## FAQ
112
115
---
@@ -117,13 +120,14 @@ Labels can be used in routes and to filter the change list:
117
120
- Make sure **Format** is `JSON` and **Protocol** is `HTTP`
118
121
- Make sure **Jenkins URL** is set under **Manage Jenkins → System**
119
122
- Look for `Notifying endpoint` or `Failed to notify endpoint` in the build log
123
+
-`NoClassDefFoundError: hudson/tasks/test/AbstractTestResultAction` in the build log means the JUnit plugin is missing. Install it
120
124
- When **Branch** is not `.*`, only builds that have a `BRANCH_NAME` environment variable matching it send notifications
121
125
122
126
</Accordion>
123
127
124
128
<Accordiontitle="Why does one build have two end events?">
125
129
126
-
The plugin sends one notification when the build completes (COMPLETED) and another when post-build actions finish (FINALIZED). Both carry the same result, so the change status does not change. To receive only one, set **Event** to `Job Finalized`, but then the queued and running phases are not shown.
130
+
The plugin sends one notification when the build completes (COMPLETED) and another when post-build actions finish (FINALIZED). Both carry the same result, so the change status does not change. When both arrive within the same second, the second one is not recorded. To receive only one, set **Event** to `Job Finalized`, but then the running phase is not shown.
0 commit comments