class_docstr: JiraOutput handles all alert dispatching for Jira
class_docstr_tok: ["JiraOutput","handles","all","alert","dispatching","for","Jira"]
docstr: Send alert to Jira
  
          Publishing:
              This output uses a default issue summary and sends the entire publication into the
              issue body as a {{code}} block. To override:
  
              - @jira.issue_summary (str):
                      Overrides the issue title that shows up at the top on the JIRA UI
  
              - @jira.description (str):
                      Send your own custom description. Remember: This field is in JIRA's syntax,
                      so it supports their custom markdown-like formatting and respects newline
                      characters (e.g. 
  ).
  
          Args:
              alert (Alert): Alert instance which triggered a rule
              descriptor (str): Output descriptor
  
          Returns:
              bool: True if alert was sent successfully, False otherwise
          
docstr_tok: ["Send","alert","to","Jira","Publishing",":","This","output","uses","a","default","issue","summary","and","sends","the","entire","publication","into","the","issue","body","as","a","{","{","code","}","}","block",".","To","override",":","-","@","jira.issue_summary","(","str",")",":","Overrides","the","issue","title","that","shows","up","at","the","top","on","the","JIRA","UI","-","@","jira.description","(","str",")",":","Send","your","own","custom","description",".","Remember",":","This","field","is","in","JIRA","'s","syntax",",","so","it","supports","their","custom","markdown-like","formatting","and","respects","newline","characters","(","e.g",".",")",".","Args",":","alert","(","Alert",")",":","Alert","instance","which","triggered","a","rule","descriptor","(","str",")",":","Output","descriptor","Returns",":","bool",":","True","if","alert","was","sent","successfully",",","False","otherwise"]
code: def _dispatch(self, alert, descriptor):
      """Send alert to Jira
  
      Publishing:
          This output uses a default issue summary and sends the entire publication into the
          issue body as a {{code}} block. To override:
  
          - @jira.issue_summary (str):
                  Overrides the issue title that shows up at the top on the JIRA UI
  
          - @jira.description (str):
                  Send your own custom description. Remember: This field is in JIRA's syntax,
                  so it supports their custom markdown-like formatting and respects newline
                  characters (e.g. \n).
  
      Args:
          alert (Alert): Alert instance which triggered a rule
          descriptor (str): Output descriptor
  
      Returns:
          bool: True if alert was sent successfully, False otherwise
      """
      creds = self._load_creds(descriptor)
      if not creds:
          return False
  
      publication = compose_alert(alert, self, descriptor)
  
      # Presentation defaults
      default_issue_summary = "StreamAlert {}".format(alert.rule_name)
      default_alert_body = "{{code:JSON}}{}{{code}}".format(
          json.dumps(publication, sort_keys=True)
      )
  
      # True Presentation values
      issue_summary = publication.get(
          "@jira.issue_summary", default_issue_summary
      )
      description = publication.get(
          "@jira.description", default_alert_body
      )
  
      issue_id = None
      comment_id = None
  
      self._base_url = creds["url"]
      self._api_key = creds["api_key"]
      self._user_name = creds["user_name"]
  
      # If aggregation is enabled, attempt to add alert to an existing issue. If a
      # failure occurs in this block, creation of a new Jira issue will be attempted.
      if creds.get("aggregate", "").lower() == "yes":
          issue_id = self._get_existing_issue(
              issue_summary, creds["project_key"]
          )
          if issue_id:
              comment_id = self._create_comment(issue_id, description)
              if comment_id:
                  LOGGER.debug(
                      "Sending alert to an existing Jira issue %s with comment %s",
                      issue_id,
                      comment_id,
                  )
                  return True
              LOGGER.error(
                  "Encountered an error when adding alert to existing "
                  "Jira issue %s. Attempting to create new Jira issue.",
                  issue_id,
              )
  
      # Create a new Jira issue
      issue_id = self._create_issue(
          issue_summary,
          creds["project_key"],
          creds["issue_type"],
          description,
      )
      if issue_id:
          LOGGER.debug("Sending alert to a new Jira issue %s", issue_id)
  
      return bool(issue_id or comment_id)
  
file_path: streamalert/streamalert/alert_processor/outputs/jira_v2.py
imports: from collections import OrderedDict
  import os
  import json
  import base64
  from streamalert.alert_processor.helpers import compose_alert
  from streamalert.alert_processor.outputs.output_base import OutputDispatcher, OutputProperty, OutputRequestFailure, StreamAlertOutput
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 11 for calling the JiraOutput obj's underlying member method code with example usage: obj._dispatch(alert, descriptor) and returns: bool, False, True