<commit_before>module JIRA::RemoteAPI

  # @group Issues

  ##
  # This method is the equivalent of making an advanced search from the
  # web interface.
  #
  # During my own testing, I found that HTTP requests could timeout for really
  # large requests (~2500 results) if you are not on the same network. So I set
  # a more reasonable upper limit; feel free to override it, but be aware of
  # the potential issues.
  #
  # The {JIRA::Issue} structure does not include any comments or attachments.
  #
  # @param [String] jql_query JQL query as a string
  # @param [Fixnum] max_results limit on number of returned results;
  #   the value may be overridden by the server if max_results is too large
  # @return [Array<JIRA::Issue>]
  def issues_from_jql_search jql_query, max_results = 2000
    array_jira_call JIRA::Issue, 'getIssuesFromJqlSearch', jql_query, max_results
  end
  alias_method :get_issues_from_jql_search, :issues_from_jql_search

  ##
  # This method can update most, but not all, issue fields. Some limitations
  # are because of how the API is designed, and some are because I have not
  # yet implemented the ability to update fields made of custom objects
  # (things in the JIRA module).
  #
  # Fields known to not update via this method:
  #
  #  - status - use {#progress_workflow_action}
  #  - attachments - use {#add_base64_encoded_attachments_to_issue_with_key}
  #
  # Though {JIRA::FieldValue} objects have an id field, they do not expect
  # to be given id values. You must use the name of the field you wish to
  # update.
  #
  # @example Usage With A Normal Field
  #  summary      = JIRA::FieldValue.new 'summary', ['My new summary']
  # @example Usage With A Custom Field
  #  custom_field = JIRA::FieldValue.new 'customfield_10060', ['123456']
  # @example Setting a field to be blank/nil
  #  description  = JIRA::FieldValue.new 'description'
  # @example Calling the method to update an issue
  #  jira_service_instance.update_issue 'PROJECT-1', description, custom_field
  #
  # @param [String] issue_key
  # @param [JIRA::FieldValue] *field_values
  # @return [JIRA::Issue]
  def update_issue issue_key, *field_values
    response = invoke('soap:updateIssue') { |msg|
      msg.add 'soap:in0', self.auth_token
      msg.add 'soap:in1', issue_key
      msg.add 'soap:in2' do |submsg|<commit_msg>Documentation tweak<commit_after>module JIRA::RemoteAPI

  # @group Issues

  ##
  # This method is the equivalent of making an advanced search from the
  # web interface.
  #
  # During my own testing, I found that HTTP requests could timeout for really
  # large requests (~2500 results) if you are not on the same network. So I set
  # a more reasonable upper limit; feel free to override it, but be aware of
  # the potential issues.
  #
  # The {JIRA::Issue} structure does not include any comments or attachments.
  #
  # @param [String] jql_query JQL query as a string
  # @param [Fixnum] max_results limit on number of returned results;
  #   the value may be overridden by the server if max_results is too large
  # @return [Array<JIRA::Issue>]
  def issues_from_jql_search jql_query, max_results = 2000
    array_jira_call JIRA::Issue, 'getIssuesFromJqlSearch', jql_query, max_results
  end
  alias_method :get_issues_from_jql_search, :issues_from_jql_search

  ##
  # This method can update most, but not all, issue fields. Some limitations
  # are because of how the API is designed, and some are because I have not
  # yet implemented the ability to update fields made of custom objects
  # (things in the JIRA module).
  #
  # Fields known to not update via this method:
  #
  #  - status - use {#progress_workflow_action}
  #  - attachments - use {#add_base64_encoded_attachments_to_issue_with_key}
  #
  # Though {JIRA::FieldValue} objects have an id field, they do not expect
  # to be given id values. You must use the name of the field you wish to
  # update.
  #
  # @example Usage With A Normal Field
  #  summary      = JIRA::FieldValue.new 'summary', 'My new summary'
  # @example Usage With A Custom Field
  #  custom_field = JIRA::FieldValue.new 'customfield_10060', '123456'
  # @example Setting a field to be blank/nil
  #  description  = JIRA::FieldValue.new 'description'
  # @example Calling the method to update an issue
  #  jira_service_instance.update_issue 'PROJECT-1', description, custom_field
  #
  # @param [String] issue_key
  # @param [JIRA::FieldValue] *field_values
  # @return [JIRA::Issue]
  def update_issue issue_key, *field_values
    response = invoke('soap:updateIssue') { |msg|
      msg.add 'soap:in0', self.auth_token
      msg.add 'soap:in1', issue_key
      msg.add 'soap:in2' do |submsg|
{'fraction_non_alphanumeric': 0.08326216908625107, 'fraction_numerical': 0.01067463706233988, 'mean_word_length': 3.829896907216495, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '486694', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1457, 'n_words': 546}