Last active
February 7, 2019 16:50
-
-
Save rrotter/8ed9e40a73ec42332c67d7169e511d83 to your computer and use it in GitHub Desktop.
Use jira-ruby Jira API Gem to make a new issue
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
#!/usr/bin/env ruby | |
require 'jira-ruby' | |
options = { | |
:username => 'service-account-user', | |
:password => 'service-account-pass', | |
:site => 'https://jira.server.domain', | |
:context_path => '/jira', | |
:auth_type => :basic | |
} | |
client = JIRA::Client.new(options) | |
issue = client.Issue.build | |
issue.save({ | |
"fields" => { | |
"summary" => "This is a summary", | |
"project" => {"key" => "PROJECT"}, | |
"issuetype" => {"name" => "Story"}, | |
"description" => "This is a description", | |
} | |
}) | |
print "Issue GUI URL: " | |
puts "#{client.options[:site]}#{client.options[:context_path]}/browse/#{issue.key}" | |
print "Issue API URL: " | |
puts issue.self |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment