Class: Fastlane::Actions::YtCommentIssueAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::YtCommentIssueAction
- Defined in:
- lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .example_code ⇒ Object
- .is_supported?(_) ⇒ Boolean
- .output ⇒ Object
- .return_type ⇒ Object
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
71 72 73 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 71 def self. ['Semen Kologrivov'] end |
.available_options ⇒ Object
36 37 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 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 36 def self. [ FastlaneCore::ConfigItem.new( key: :issue_id, description: 'Identifier of commented issue', optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :comment, description: 'Text of comment', optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :base_url, env_name: 'YOUTRACK_BASE_URL', description: 'Base YouTrack URL', optional: false, type: String ), FastlaneCore::ConfigItem.new( key: :access_token, env_name: 'YOUTRACK_API_TOKEN', description: 'Access token for YouTrack API', optional: false, type: String ) ] end |
.description ⇒ Object
28 29 30 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 28 def self.description 'Add a comment to issue by passed identifier' end |
.details ⇒ Object
32 33 34 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 32 def self.details '' end |
.example_code ⇒ Object
79 80 81 82 83 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 79 def self.example_code [ 'yt_comment_issue(issue_id: "ios_1234", comment: "Lorem ipsum")' ] end |
.is_supported?(_) ⇒ Boolean
75 76 77 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 75 def self.is_supported?(_) true end |
.output ⇒ Object
85 86 87 88 89 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 85 def self.output [ [] ] end |
.return_type ⇒ Object
91 92 93 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 91 def self.return_type :array end |
.return_value ⇒ Object
67 68 69 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 67 def self.return_value 'Nothing' end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fastlane/plugin/youtrack/actions/yt_comment_issue_action.rb', line 7 def self.run(params) issue_id = params[:issue_id] comment = params[:comment] base_url = params[:base_url] access_token = params[:access_token] result = Helper::YoutrackHelper.comment_issue(issue_id, comment, base_url, access_token) return {} unless result.success? begin response_body = JSON.parse(result.body) rescue JSON::ParserError => e puts e end response_body rescue => ex UI.error(ex) UI.error('Failed') end |