Class: Fastlane::Actions::JiraAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::JiraAction
- Defined in:
- fastlane/lib/fastlane/actions/jira.rb
Constant Summary
Constants inherited from Fastlane::Action
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .category ⇒ Object
- .description ⇒ Object
- .example_code ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
Class Method Summary collapse
Methods inherited from Fastlane::Action
action_name, author, deprecated_notes, details, lane_context, method_missing, other_action, output, return_type, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.authors ⇒ Object
77 78 79 |
# File 'fastlane/lib/fastlane/actions/jira.rb', line 77 def self. ["iAmChrisTruman"] end |
.available_options ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'fastlane/lib/fastlane/actions/jira.rb', line 38 def self. [ FastlaneCore::ConfigItem.new(key: :url, env_name: "FL_JIRA_SITE", description: "URL for Jira instance", verify_block: proc do |value| UI.user_error!("No url for Jira given, pass using `url: 'url'`") if value.to_s.length == 0 end), FastlaneCore::ConfigItem.new(key: :username, env_name: "FL_JIRA_USERNAME", description: "Username for JIRA instance", verify_block: proc do |value| UI.user_error!("No username") if value.to_s.length == 0 end), FastlaneCore::ConfigItem.new(key: :password, env_name: "FL_JIRA_PASSWORD", description: "Password for Jira", sensitive: true, verify_block: proc do |value| UI.user_error!("No password") if value.to_s.length == 0 end), FastlaneCore::ConfigItem.new(key: :ticket_id, env_name: "FL_JIRA_TICKET_ID", description: "Ticket ID for Jira, i.e. IOS-123", verify_block: proc do |value| UI.user_error!("No Ticket specified") if value.to_s.length == 0 end), FastlaneCore::ConfigItem.new(key: :comment_text, env_name: "FL_JIRA_COMMENT_TEXT", description: "Text to add to the ticket as a comment", verify_block: proc do |value| UI.user_error!("No comment specified") if value.to_s.length == 0 end) ] end |
.category ⇒ Object
97 98 99 |
# File 'fastlane/lib/fastlane/actions/jira.rb', line 97 def self.category :misc end |
.description ⇒ Object
34 35 36 |
# File 'fastlane/lib/fastlane/actions/jira.rb', line 34 def self.description "Leave a comment on JIRA tickets" end |
.example_code ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 |
# File 'fastlane/lib/fastlane/actions/jira.rb', line 85 def self.example_code [ 'jira( url: "https://bugs.yourdomain.com", username: "Your username", password: "Your password", ticket_id: "Ticket ID, i.e. IOS-123", comment_text: "Text to post as a comment" )' ] end |
.is_supported?(platform) ⇒ Boolean
81 82 83 |
# File 'fastlane/lib/fastlane/actions/jira.rb', line 81 def self.is_supported?(platform) true end |
.return_value ⇒ Object
74 75 |
# File 'fastlane/lib/fastlane/actions/jira.rb', line 74 def self.return_value end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'fastlane/lib/fastlane/actions/jira.rb', line 4 def self.run(params) Actions.verify_gem!('jira-ruby') require 'jira-ruby' site = params[:url] context_path = "" auth_type = :basic username = params[:username] password = params[:password] ticket_id = params[:ticket_id] comment_text = params[:comment_text] = { site: site, context_path: context_path, auth_type: auth_type, username: username, password: password } client = JIRA::Client.new() issue = client.Issue.find(ticket_id) comment = issue.comments.build comment.save({ 'body' => comment_text }) end |