               [:p
                "Configure JIRA to create issues from CircleCI's build page."]
               (when show-modal?
-                (letfn [(close-modal! []
-                          (om/set-state! owner :show-modal? false))
-                        (close-fn [_]
-                          (close-modal!)
-                          (track-event :cancel-clicked "jira-credentials-modal"))]
-                  (modal/modal-dialog
-                   {:title "Add a JIRA token"
-                    :body (html
-                           [:div
-                            [:p "Configure JIRA to create issues from CircleCI’s build page."]
-                            (form/form {}
-                                       (om/build form/text-field {:label "JIRA username"
-                                                                  :value (:username credentials)
-                                                                  :on-change #(utils/edit-input owner (jira-input-path :username) %)})
-                                       (om/build form/text-field {:label "JIRA password"
-                                                                  :password? true
-                                                                  :value (:password credentials)
-                                                                  :on-change #(utils/edit-input owner (jira-input-path :password) %)})
-                                       (om/build form/text-field {:label "JIRA base hostname"
-                                                                  :value (:base_url credentials)
-                                                                  :on-change #(utils/edit-input owner (jira-input-path :base_url) %)}))])
-                    :actions [(button/button {:on-click close-fn} "Cancel")
-                              (button/managed-button
-                               {:failed-text "Failed"
-                                :success-text "Saved"
-                                :loading-text "Saving..."
-                                :kind :primary
-                                :on-click (fn [_]
-                                            (raise! owner
-                                                    [:saved-project-settings {:project-id project-id
-                                                                              :merge-paths [[:jira]]
-                                                                              :on-success close-modal!}])
-                                            (track-event :save-clicked "jira-credentials-modal"))}
-                               "Save")]
-                    :close-fn close-fn})))
+                (letfn [(close-fn [_]
+                          (om/set-state! owner :show-modal? false)
+                          (track-event :cancel-clicked))]
+                  (jira-basic-modal {:project project
+                                     :close-fn close-fn
+                                     :track-fn track-event
+                                     :jira-input-path jira-input-path}
+                                    owner)))
               (when-let [credentials (:jira project)]
                 (letfn [(linkify [url]
                           (html

              [:p
               "Install the CircleCI JIRA add-on from the Atlassian Marketplace and add the token here."]
              (when show-modal?
                (letfn [(close-modal! []
                          (om/set-state! owner :show-modal? false))
                        (close-fn [_]
                          (close-modal!)
                          (track-event :cancel-clicked "jira-credentials-modal"))]
                  (modal/modal-dialog
                   {:title "Add a JIRA token"
                    :body (html
                           [:div
                            [:p "Configure JIRA to create issues from CircleCI’s build page."]
                            (form/form {}
                                       (om/build form/text-field
                                                 {:label "Token"
                                                  :require true
                                                  :value token
                                                  :on-change #(utils/edit-input owner
                                                                                jira-input-path
                                                                                %)}))])
                    :actions [(button/button {:on-click close-fn} "Cancel")
                              (button/managed-button
                               {:failed-text "Failed"
                                :success-text "Saved"
                                :loading-text "Saving..."
                                :kind :primary
                                :on-click (fn [_]
                                            (raise! owner
                                                    [:saved-project-settings {:project-id project-id
                                                                              :merge-paths [[:jira]]
                                                                              :on-success close-modal!}])
                                            (track-event :save-clicked "jira-credentials-modal"))}
                               "Save")]
                    :close-fn close-fn})))
              (when-let [credentials (:jira project)]
                (letfn [(linkify [url]
                          (html

    om/IRenderState
    (render-state [_ {:keys [show-modal?]}]
      (let [project (:project project-data)
            project-id (project-model/id project)
            jira-input-path (conj state/inputs-path :jira :circle_token)
            track-event (fn [event-type component]
