<commit_before>require 'jira-ruby'

module Fastlane
  module Actions
    class JiraWorkFlowAction < Action
      
      def self.run(params)

        # Authorization
        options = {
          :username     => params[:jira_username],
          :password     => params[:jira_password],
          :site         => params[:jira_host],
          :context_path => '',
          :auth_type    => :basic
        }
        @client = JIRA::Client.new(options)

        puts "Jira issues #{params[:issue_ids]}"

        # Move
        issues = params[:issue_ids].uniq
        issues.each do |issue_id|
          move_issue(issue_id, params[:jira_transition_name])
        end

      end

      def  self.move_issue(issue_id, transition_name)

        # Find Issue
        issue = @client.Issue.find(issue_id)
        if !issue
          puts "Issue #{issue_id} not found"
          return
        end

        # Find Transition
        transitions = @client.Transition.all(issue: issue)
        transition = transitions.find{ |elem| elem.name == transition_name }
        if !transition<commit_msg>Update jira_work_flow.rb<commit_after>require 'jira-ruby'

module Fastlane
  module Actions
    class JiraWorkFlowAction < Action
      
      def self.run(params)

        # Authorization
        options = {
          :username     => params[:jira_username],
          :password     => params[:jira_password],
          :site         => params[:jira_host],
          :context_path => '',
          :auth_type    => :basic
        }
        @client = JIRA::Client.new(options)

        puts "Jira issues #{params[:issue_ids]}"

        # Move
        issues = params[:issue_ids].uniq
        issues.each do |issue_id|
          move_issue(issue_id, params[:jira_transition_name])
        end

      end

      def  self.move_issue(issue_id, transition_name)

        # Find Issue
        issue = @client.Issue.find(issue_id)
        if !issue
          puts "Issue #{issue_id} not found"
          return
        end
        
        if issue.status.name == 'Resolved' || issue.status.name == 'Closed'
          return
        end

        # Find Transition
        transitions = @client.Transition.all(issue: issue)
        transition = transitions.find{ |elem| elem.name == transition_name }
        if !transition
{'fraction_non_alphanumeric': 0.10186389250108366, 'fraction_numerical': 0.0, 'mean_word_length': 1.8922305764411027, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2744352', 'n_tokens_mistral': 671, 'n_tokens_neox': 651, 'n_words': 139}