anchor.diff:          <%- active_stage = pipeline_model.getLatestPipelineInstance().activeStage() -%>
           <%- if active_stage.hasPreviousStage() -%>
           "previous_instance": { <%# TODO: Handle previously blurb. %>
  -          "result": <%== active_stage.getPreviousStage().getResult().to_s.to_json() %>,
  -          "details_path": <%== stage_detail_path_for_identifier(active_stage.getPreviousStage().getIdentifier()).to_s.to_json() %>,
  -          "pipeline_label": <%== active_stage.getPreviousStage().getIdentifier().getPipelineLabel().to_json() %>
  +          "result": <%== active_stage.getPreviousStage().getResult().to_s.to_json %>,
  +          "details_path": <%== stage_detail_path_for_identifier(active_stage.getPreviousStage().getIdentifier()).to_s.to_json %>,
  +          "pipeline_label": <%== active_stage.getPreviousStage().getIdentifier().getPipelineLabel().to_json %>
           },
           <%- end -%>
           <%- end -%>
  
positive.code:         <%- if pipeline_model.canOperate() -%>
            {
              "operation": "trigger",
              "operation_path": <%== api_pipeline_action_path(:pipeline_name => pipeline_model.getName(), :action => "schedule").to_json() %>
            },
            {
              "operation": "trigger_with_options",
              "operation_path": <%== pipeline_show_with_option_path.to_json() %>
            },
            {
              "operation": <%== (is_paused ? "unpause" : "pause").to_json() %>,
              "operation_path": <%== (is_paused ? unpause_pipeline_path(pipeline_model.getName()) : pause_pipeline_path(pipeline_model.getName())).to_json() %>
            }
          <%- end -%>
          ],
  
negative.code:           <%- if active_instance.hasHistoricalData() -%>
            {
              "has_history": "true",
              "label": <%== active_instance.getLabel().to_json %>,
              "scheduled_time": <%== active_instance.getScheduledDate().getTime().to_json %>,
              "history_path": <%== url_for_pipeline(active_instance.getName()).to_json %>,
              "settings_path": <%== pipeline_edit_path(:pipeline_name => active_instance.getName(), :current_tab => "general").to_json %>,
              "vsm_path": <%== url_for_pipeline_value_stream_map(active_instance, :only_path => true).to_json %>,
              "compare_path": <%== compare_pipelines_path(:pipeline_name => active_instance.getName(), :from_counter => active_instance.getCounter() - 1, :to_counter => active_instance.getCounter()).to_json %>,
              "build_cause_path": <%== build_cause_path(:pipeline_name => active_instance.getName(), :pipeline_counter => active_instance.getCounter()).to_json %>,
              <%-# TODO: As in pipelines_helper.rb#trigger_message, check the pim type against PreparingToScheduleInstance? -%>
              "triggered_by": <%== active_instance.getApprovedBy().to_json %>,
              <%- latest_stage = active_instance.latestStage() -%>
              "latest_stage_name": <%== latest_stage.getName().to_json %>,
              "latest_stage_state": <%== latest_stage.getState().to_s.to_json %>,
  
              <%-# ====== ====== EVERY STAGE IN THIS PIPELINE INSTANCE ====== ====== -%>
              "stages": [
                <%- active_instance.getStageHistory().each_with_index do |stage, stage_index| -%>
                <%- is_last_stage = stage_index == active_instance.getStageHistory().count - 1 -%>
                {
                  "name": <%== stage.getName().to_json %>,
                  "status": "<%== stage.getState() %>",
                  "details_path": <%== stage_detail_tab_path(:pipeline_name => active_instance.getName(), :pipeline_counter => active_instance.getCounter(),
                  :stage_name => stage.getName(), :stage_counter => stage.getCounter(), :only_path => true).to_json %>
                }<%== is_last_stage ? "" : "," %>
                <%- end -%>
              ]
  