A piece of workable ruby code to update jira tickets – with ruby 1.9.3-p448 and jiralicious(0.3.0)

require 'rubygems'
require 'jiralicious'

USERNAME = "***"
PASSWORD = "***"
JIRA_URL = "https://example.com"

Jiralicious.configure do |config|
# Leave out username and password
config.username = USERNAME
config.password = PASSWORD
config.uri = JIRA_URL
config.api_version = "latest"
config.auth_type = :basic
end

r = Jiralicious.search("project = PHX AND issuetype = Bug AND status = Resolved")
r.issues.each do |issue|

#print the key with issue.jira_key
p "+++++++++++++ resolved bug found: #{issue.jira_key} +++++++++++++"

#Trigger a transition on this issue: the id of this transition may different on another project.
Jiralicious::Issue::Transitions.go(issue.jira_key, 351)

#Add a comment on the issue.
Jiralicious::Issue::Comment.add("fix included in build: you build No.", issue.jira_key)
end

Leave a comment