Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3e697062
Commit
3e697062
authored
Feb 05, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nicer closing message in comment.
parent
1173f2e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+16
-14
spec/services/git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+1
-1
No files found.
app/models/project_services/jira_service.rb
View file @
3e697062
...
...
@@ -95,18 +95,18 @@ class JiraService < IssueTrackerService
def
close_issue
(
push_data
,
issue_name
)
url
=
close_issue_url
(
issue_name
)
commit
_url
=
push_data
[
:commits
].
first
[
:url
]
commit
=
push_data
[
:commits
].
first
message
=
{
'update'
=>
{
'comment'
=>
[{
'add'
=>
{
'body'
=>
"Issue solved with
#{
commit_url
}
"
update:
{
comment:
[{
add:
{
body:
"Issue solved with [
#{
commit
[
:id
]
}
|
#{
commit
[
:url
]
}
].
"
}
}]
},
'transition'
=>
{
'id'
=>
jira_issue_transition_id
transition:
{
id:
jira_issue_transition_id
}
}.
to_json
...
...
@@ -130,13 +130,6 @@ class JiraService < IssueTrackerService
send_message
(
url
,
message
)
end
def
close_issue_url
(
issue_name
)
"
#{
server_url
}
/rest/api/
#{
self
.
api_version
}
/issue/
#{
issue_name
}
/transitions"
end
def
add_comment_url
(
issue_name
)
"
#{
server_url
}
/rest/api/
#{
self
.
api_version
}
/issue/
#{
issue_name
}
/comment"
end
def
auth
require
'base64'
...
...
@@ -185,4 +178,13 @@ class JiraService < IssueTrackerService
def
resource_url
(
resource
)
"
#{
Settings
.
gitlab
[
'url'
].
chomp
(
"/"
)
}#{
resource
}
"
end
def
close_issue_url
(
issue_name
)
"
#{
server_url
}
/rest/api/
#{
self
.
api_version
}
/issue/
#{
issue_name
}
/transitions"
end
def
add_comment_url
(
issue_name
)
"
#{
server_url
}
/rest/api/
#{
self
.
api_version
}
/issue/
#{
issue_name
}
/comment"
end
end
spec/services/git_push_service_spec.rb
View file @
3e697062
...
...
@@ -273,7 +273,7 @@ describe GitPushService do
update:
{
comment:
[{
add:
{
body:
"Issue solved with
http://localhost/
#{
project
.
path_with_namespace
}
/commit/
#{
closing_commit
.
id
}
"
body:
"Issue solved with
[
#{
closing_commit
.
id
}
|http://localhost/
#{
project
.
path_with_namespace
}
/commit/
#{
closing_commit
.
id
}
].
"
}
}]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment