Created
June 8, 2011 14:57
-
-
Save MrPink/1014587 to your computer and use it in GitHub Desktop.
Nagios2Jira
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'jira4r' | |
jira = Jira4R::JiraTool.new(2, "http://ourjira.onjira.com") | |
jira.login("user", "password") | |
# create the issue. | |
options = {} | |
OptionParser.new do |opts| | |
opts.on("-s", "--summary summary text") do |s| | |
issue = Jira4R::V2::RemoteIssue.new | |
issue.project = "SA" | |
@summary = s | |
issue.summary = @summary | |
opts.on("-d", "--description text") do |d| | |
@description = d | |
issue.description = @description | |
opts.on("-a", "--assignee username") do |a| | |
@assignee = a | |
issue.assignee = @assignee | |
issue.type = "3" | |
jira.createIssue(issue) | |
end | |
end | |
end | |
end.parse! |
I'm trolling. It fits within 30 lines, anything goes within those bounds. :)
tl;dr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know its awful but it works, can I reduce the amount of opts.on?