Commit 361432af authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'issue-133-custom-jira-issue-transition-id' into 'master'

Issue 133 custom jira issue transition

Fixed #133

![](https://dev.gitlab.org/uploads/gitlab/gitlab-ee/2947f69a9b/Screen_Shot_2014-08-11_at_22.04.35.png)

See merge request !141
parents cb5c3625 196921e5
...@@ -42,7 +42,8 @@ class JiraService < Service ...@@ -42,7 +42,8 @@ class JiraService < Service
{ type: 'text', name: 'project_url', placeholder: 'Url to JIRA, http://jira.example' }, { type: 'text', name: 'project_url', placeholder: 'Url to JIRA, http://jira.example' },
{ type: 'text', name: 'username', placeholder: '' }, { type: 'text', name: 'username', placeholder: '' },
{ type: 'password', name: 'password', placeholder: '' }, { type: 'password', name: 'password', placeholder: '' },
{ type: 'text', name: 'api_version', placeholder: '2' } { type: 'text', name: 'api_version', placeholder: '2' },
{ type: 'text', name: 'jira_issue_transition_id', placeholder: '2' }
] ]
end end
...@@ -69,7 +70,7 @@ class JiraService < Service ...@@ -69,7 +70,7 @@ class JiraService < Service
}] }]
}, },
'transition' => { 'transition' => {
'id' => '2' 'id' => jira_issue_transition_id
} }
} }
......
class AddJiraIssueTransitionIdToServices < ActiveRecord::Migration
def up
add_column :services, :jira_issue_transition_id, :string, default: '2'
Service.reset_column_information
Service.where(jira_issue_transition_id: nil).update_all jira_issue_transition_id: '2'
end
def down
remove_column :services, :jira_issue_transition_id
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140611135229) do ActiveRecord::Schema.define(version: 20140811155127) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -273,10 +273,10 @@ ActiveRecord::Schema.define(version: 20140611135229) do ...@@ -273,10 +273,10 @@ ActiveRecord::Schema.define(version: 20140611135229) do
t.string "type" t.string "type"
t.string "title" t.string "title"
t.string "token" t.string "token"
t.integer "project_id", null: false t.integer "project_id", null: false
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.boolean "active", default: false, null: false t.boolean "active", default: false, null: false
t.string "project_url" t.string "project_url"
t.string "subdomain" t.string "subdomain"
t.string "room" t.string "room"
...@@ -285,6 +285,7 @@ ActiveRecord::Schema.define(version: 20140611135229) do ...@@ -285,6 +285,7 @@ ActiveRecord::Schema.define(version: 20140611135229) do
t.string "username" t.string "username"
t.string "password" t.string "password"
t.string "api_version" t.string "api_version"
t.string "jira_issue_transition_id", default: "2"
end end
add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree
...@@ -325,12 +326,12 @@ ActiveRecord::Schema.define(version: 20140611135229) do ...@@ -325,12 +326,12 @@ ActiveRecord::Schema.define(version: 20140611135229) do
end end
create_table "users", force: true do |t| create_table "users", force: true do |t|
t.string "email", default: "", null: false t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false t.string "encrypted_password", default: "", null: false
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at" t.datetime "reset_password_sent_at"
t.datetime "remember_created_at" t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0 t.integer "sign_in_count", default: 0
t.datetime "current_sign_in_at" t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at" t.datetime "last_sign_in_at"
t.string "current_sign_in_ip" t.string "current_sign_in_ip"
...@@ -338,24 +339,24 @@ ActiveRecord::Schema.define(version: 20140611135229) do ...@@ -338,24 +339,24 @@ ActiveRecord::Schema.define(version: 20140611135229) do
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "name" t.string "name"
t.boolean "admin", default: false, null: false t.boolean "admin", default: false, null: false
t.integer "projects_limit", default: 10 t.integer "projects_limit", default: 10
t.string "skype", default: "", null: false t.string "skype", default: "", null: false
t.string "linkedin", default: "", null: false t.string "linkedin", default: "", null: false
t.string "twitter", default: "", null: false t.string "twitter", default: "", null: false
t.string "authentication_token" t.string "authentication_token"
t.integer "theme_id", default: 1, null: false t.integer "theme_id", default: 1, null: false
t.string "bio" t.string "bio"
t.integer "failed_attempts", default: 0 t.integer "failed_attempts", default: 0
t.datetime "locked_at" t.datetime "locked_at"
t.string "extern_uid" t.string "extern_uid"
t.string "provider" t.string "provider"
t.string "username" t.string "username"
t.boolean "can_create_group", default: true, null: false t.boolean "can_create_group", default: true, null: false
t.boolean "can_create_team", default: true, null: false t.boolean "can_create_team", default: true, null: false
t.string "state" t.string "state"
t.integer "color_scheme_id", default: 1, null: false t.integer "color_scheme_id", default: 1, null: false
t.integer "notification_level", default: 1, null: false t.integer "notification_level", default: 1, null: false
t.datetime "password_expires_at" t.datetime "password_expires_at"
t.integer "created_by_id" t.integer "created_by_id"
t.datetime "last_credential_check_at" t.datetime "last_credential_check_at"
...@@ -364,8 +365,9 @@ ActiveRecord::Schema.define(version: 20140611135229) do ...@@ -364,8 +365,9 @@ ActiveRecord::Schema.define(version: 20140611135229) do
t.datetime "confirmed_at" t.datetime "confirmed_at"
t.datetime "confirmation_sent_at" t.datetime "confirmation_sent_at"
t.string "unconfirmed_email" t.string "unconfirmed_email"
t.boolean "hide_no_ssh_key", default: false t.boolean "hide_no_ssh_key", default: false
t.string "website_url", default: "", null: false t.string "website_url", default: "", null: false
t.datetime "admin_email_unsubscribed_at"
end end
add_index "users", ["admin"], name: "index_users_on_admin", using: :btree add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
......
...@@ -55,5 +55,13 @@ describe JiraService, models: true do ...@@ -55,5 +55,13 @@ describe JiraService, models: true do
body: /Issue solved with/ body: /Issue solved with/
).once ).once
end end
it "calls the api with jira_issue_transition_id" do
@jira_service.jira_issue_transition_id = 'this-is-a-custom-id'
@jira_service.execute(@sample_data, JiraIssue.new("JIRA-123"))
WebMock.should have_requested(:post, @api_url).with(
body: /this-is-a-custom-id/
).once
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment