Class: Fastlane::Actions::GetJiraIssueAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::GetJiraIssueAction
- Defined in:
- lib/fastlane/plugin/jira_issue_details/actions/get_jira_issue.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
44 45 46 |
# File 'lib/fastlane/plugin/jira_issue_details/actions/get_jira_issue.rb', line 44 def self. ["Zaim Ramlan"] end |
.available_options ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/fastlane/plugin/jira_issue_details/actions/get_jira_issue.rb', line 56 def self. [ FastlaneCore::ConfigItem.new(key: :username, env_name: "JIRA_ISSUE_DETAILS_USERNAME", description: "Your Jira Username", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :api_token, env_name: "JIRA_ISSUE_DETAILS_API_TOKEN", description: "Your Jira API Token", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :site, env_name: "JIRA_ISSUE_DETAILS_SITE", description: "Your Jira Site ('http://yourdomain.atlassian.net')", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :issue_key, env_name: "JIRA_ISSUE_DETAILS_ISSUE_KEY", description: "Your Jira Issue Key", optional: false, type: String) ] end |
.description ⇒ Object
40 41 42 |
# File 'lib/fastlane/plugin/jira_issue_details/actions/get_jira_issue.rb', line 40 def self.description "Get the details for the given jira issue key." end |
.details ⇒ Object
52 53 54 |
# File 'lib/fastlane/plugin/jira_issue_details/actions/get_jira_issue.rb', line 52 def self.details "It utilises the `jira-ruby` gem to communicate with Jira and get the details of the Jira issue for the given key.\n\n(Currently only supports basic auth_type login)" end |
.is_supported?(platform) ⇒ Boolean
84 85 86 |
# File 'lib/fastlane/plugin/jira_issue_details/actions/get_jira_issue.rb', line 84 def self.is_supported?(platform) true end |
.return_value ⇒ Object
48 49 50 |
# File 'lib/fastlane/plugin/jira_issue_details/actions/get_jira_issue.rb', line 48 def self.return_value "Return a `Hash` containing the details of the jira issue for the given key, or `nil` if the issue key does not exists." end |
.run(params) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fastlane/plugin/jira_issue_details/actions/get_jira_issue.rb', line 8 def self.run(params) site = ENV['JIRA_ISSUE_DETAILS_SITE'] username = ENV['JIRA_ISSUE_DETAILS_USERNAME'] api_token = ENV['JIRA_ISSUE_DETAILS_API_TOKEN'] issue_key = ENV['JIRA_ISSUE_DETAILS_ISSUE_KEY'] if params && params[:site] && params[:username] && params[:api_token] && params[:issue_key] site = params[:site] username = params[:username] api_token = params[:api_token] issue_key = params[:issue_key] end return nil if site.nil? && username.nil? && api_token.nil? && issue_key.nil? = { username: username, password: api_token, context_path: "", auth_type: :basic, site: "#{site}:443/", rest_base_path: "/rest/api/3" } client = JIRA::Client.new() begin return client.Issue.find(issue_key).attrs rescue return nil end end |