jiraSOAP 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +17 -0
- data/LICENSE +1 -1
- data/README.markdown +5 -8
- data/lib/jiraSOAP.rb +3 -3
- data/lib/jiraSOAP/JIRAservice.rb +7 -4
- data/lib/jiraSOAP/{remoteAPI.rb → api.rb} +69 -89
- data/lib/jiraSOAP/entities.rb +26 -0
- data/lib/jiraSOAP/entities/abstract.rb +95 -0
- data/lib/jiraSOAP/entities/attachments.rb +35 -0
- data/lib/jiraSOAP/entities/avatar.rb +36 -0
- data/lib/jiraSOAP/entities/comment.rb +54 -0
- data/lib/jiraSOAP/entities/field_value.rb +73 -0
- data/lib/jiraSOAP/entities/filter.rb +26 -0
- data/lib/jiraSOAP/entities/issue.rb +166 -0
- data/lib/jiraSOAP/entities/issue_properties.rb +41 -0
- data/lib/jiraSOAP/entities/project.rb +57 -0
- data/lib/jiraSOAP/entities/read_only.rb +121 -0
- data/lib/jiraSOAP/entities/schemes.rb +25 -0
- data/lib/jiraSOAP/entities/user.rb +23 -0
- data/lib/jiraSOAP/entities/version.rb +45 -0
- data/lib/jiraSOAP/handsoap_extensions.rb +68 -0
- data/lib/{macruby_stuff.rb → jiraSOAP/macruby_bonuses.rb} +1 -1
- data/lib/jiraSOAP/url.rb +3 -3
- metadata +27 -10
- data/lib/jiraSOAP/remoteEntities.rb +0 -772
data/ChangeLog
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
Version 0.5
|
2
|
+
|
3
|
+
* Begin summarizing changes in a changelog
|
4
|
+
* Begin abstracting parts of JIRA model
|
5
|
+
|
6
|
+
* Fixed RemoteAPI#add_version_to_project_with_key
|
7
|
+
|
8
|
+
* Added RemoteAPI#get_server_configuration
|
9
|
+
|
10
|
+
* Changed use of factories to constructors in the model
|
11
|
+
* Changed FieldValue#id to FieldValue#field_name
|
12
|
+
* Changed CustomField to CustomFieldValue
|
13
|
+
* Changed User#name to User#username
|
14
|
+
* Changed Scheme#type to return the class name
|
15
|
+
* Changed some RemoteAPI method names to be more descriptive
|
16
|
+
* Changed Avatar#content_type to Avatar#mime_type
|
17
|
+
* Various documentation updates
|
data/LICENSE
CHANGED
data/README.markdown
CHANGED
@@ -3,6 +3,8 @@ jiraSOAP - Ruby interface to the JIRA SOAP API
|
|
3
3
|
|
4
4
|
Uses [handsoap](http://wiki.github.com/unwire/handsoap/) to build a client for the JIRA SOAP API that works on MacRuby as well as Ruby 1.9.
|
5
5
|
|
6
|
+
Read the documentation [here](http://rdoc.info/github/Marketcircle/jiraSOAP/master/frames). The meat of the service is in the `RemoteAPI` module.
|
7
|
+
|
6
8
|
|
7
9
|
Motivation
|
8
10
|
----------
|
@@ -18,6 +20,7 @@ Pick up where `jira4r` left off:
|
|
18
20
|
- Implement the current API; `jira4r` does not implement APIs from JIRA 4.x
|
19
21
|
- More natural interface; not adhering to the API when the API is weird
|
20
22
|
- Speed; network latency is bad enough
|
23
|
+
- Excellent documentation, since the documentation given by Atlassian is so terse
|
21
24
|
|
22
25
|
|
23
26
|
Getting Started
|
@@ -44,22 +47,16 @@ Once that ugliness is over with, you can run a quick demo (making appropriate su
|
|
44
47
|
|
45
48
|
db.logout
|
46
49
|
|
47
|
-
Get the [Gist](http://gist.github.com/612186).
|
48
|
-
|
49
|
-
Read the documentation [here](http://rdoc.info/github/Marketcircle/jiraSOAP/master/frames). The meat of the service is in the `RemoteAPI` module.
|
50
|
-
|
51
50
|
|
52
51
|
TODO
|
53
52
|
----
|
54
53
|
|
54
|
+
- Finish implementing all of the API
|
55
|
+
- Stabilize API
|
55
56
|
- Performance optimizations; there are a number of places that can be optimized
|
56
57
|
+ Using GCD/Threads for parsing arrays of results; a significant speed up for large types and large arrays (ie. creating issues from JQL searches)
|
57
|
-
- Refactor for a smaller code base
|
58
|
-
- Fix type hacks;. dates should be `NSDate`s and URLs should be `NSURL`s, right now they are all strings
|
59
58
|
- Public test suite
|
60
59
|
+ Needs a mock server
|
61
|
-
- Error handling
|
62
|
-
- Finish implementing all of the API
|
63
60
|
|
64
61
|
|
65
62
|
Note on Patches/Pull Requests
|
data/lib/jiraSOAP.rb
CHANGED
@@ -7,10 +7,10 @@ Handsoap.http_driver = :net_http
|
|
7
7
|
|
8
8
|
require 'jiraSOAP/url.rb'
|
9
9
|
require 'jiraSOAP/handsoap_extensions.rb'
|
10
|
-
require 'jiraSOAP/
|
11
|
-
require 'jiraSOAP/
|
10
|
+
require 'jiraSOAP/entities.rb'
|
11
|
+
require 'jiraSOAP/api.rb'
|
12
12
|
|
13
13
|
require 'jiraSOAP/JIRAservice.rb'
|
14
14
|
|
15
15
|
#overrides and additions
|
16
|
-
require 'lib/
|
16
|
+
require 'lib/jiraSOAP/macruby_bonuses.rb' if RUBY_ENGINE == 'macruby'
|
data/lib/jiraSOAP/JIRAservice.rb
CHANGED
@@ -20,9 +20,13 @@ class JIRAService < Handsoap::Service
|
|
20
20
|
|
21
21
|
# @return [String]
|
22
22
|
attr_reader :auth_token
|
23
|
+
|
23
24
|
# @return [String]
|
24
25
|
attr_reader :user
|
25
26
|
|
27
|
+
# @return [String]
|
28
|
+
attr_reader :endpoint_url
|
29
|
+
|
26
30
|
# Factory method to initialize and login.
|
27
31
|
# @param [String] url URL for the JIRA server
|
28
32
|
# @param [String] user JIRA user name to login with
|
@@ -37,8 +41,6 @@ class JIRAService < Handsoap::Service
|
|
37
41
|
# Slightly hacky in order to set the endpoint at the initialization.
|
38
42
|
# @param endpoint_url URL for the JIRA server
|
39
43
|
def initialize(endpoint_url)
|
40
|
-
super
|
41
|
-
|
42
44
|
@endpoint_url = endpoint_url
|
43
45
|
endpoint_data = {
|
44
46
|
:uri => "#{endpoint_url}/rpc/soap/jirasoapservice-v2",
|
@@ -52,8 +54,9 @@ class JIRAService < Handsoap::Service
|
|
52
54
|
def method_missing(method, *args)
|
53
55
|
message = "#{method} is not a valid method. Check the documentation; the "
|
54
56
|
message << 'method may not be implemented or has changed in recent '
|
55
|
-
message << 'revisions. The
|
56
|
-
|
57
|
+
message << 'revisions. The API has not been stabilized yet.'
|
58
|
+
STDERR.puts message
|
59
|
+
super method, *args
|
57
60
|
end
|
58
61
|
|
59
62
|
protected
|
@@ -1,7 +1,15 @@
|
|
1
1
|
# Contains the API defined by Atlassian for the JIRA SOAP service. The JavaDoc
|
2
2
|
# for the SOAP API is located at http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/com/atlassian/jira/rpc/soap/JiraSoapService.html.
|
3
3
|
# @todo exception handling
|
4
|
+
# @todo logging
|
4
5
|
# @todo code refactoring and de-duplication
|
6
|
+
# @todo break the API down by task, like Apple's developer documentation
|
7
|
+
# @todo deleteProjectAvatar [target v0.5]
|
8
|
+
# @todo setProjectAvatar (change to different existing) [target v0.5]
|
9
|
+
# @todo setNewProjectAvatar (upload new and set it) [target v0.5]
|
10
|
+
# @todo createProjectRole [v0.6]
|
11
|
+
# @todo getAvailableActions [target v0.7]
|
12
|
+
# @todo progressWorkflowAction [target v0.7]
|
5
13
|
module RemoteAPI
|
6
14
|
# XPath constant to get a node containing a response array.
|
7
15
|
# This could be used for all responses, but is only used in cases where we
|
@@ -11,7 +19,7 @@ module RemoteAPI
|
|
11
19
|
# The first method to call; other methods will fail until you are logged in.
|
12
20
|
# @param [String] user JIRA user name to login with
|
13
21
|
# @param [String] password
|
14
|
-
# @return [
|
22
|
+
# @return [boolean] true if successful, otherwise an exception is thrown
|
15
23
|
def login(user, password)
|
16
24
|
response = invoke('soap:login') { |msg|
|
17
25
|
msg.add 'soap:in0', user
|
@@ -25,12 +33,12 @@ module RemoteAPI
|
|
25
33
|
|
26
34
|
# You only need to call this to make an explicit logout; normally, a session
|
27
35
|
# will automatically expire after a set time (configured on the server).
|
28
|
-
# @return [
|
36
|
+
# @return [boolean] true if successful, otherwise false
|
29
37
|
def logout
|
30
38
|
response = invoke('soap:logout') { |msg|
|
31
39
|
msg.add 'soap:in0', @auth_token
|
32
40
|
}
|
33
|
-
response.document.xpath('//logoutReturn').
|
41
|
+
response.document.xpath('//logoutReturn').to_boolean
|
34
42
|
end
|
35
43
|
|
36
44
|
# @return [[JIRA::Priority]]
|
@@ -39,8 +47,7 @@ module RemoteAPI
|
|
39
47
|
msg.add 'soap:in0', @auth_token
|
40
48
|
}
|
41
49
|
response.document.xpath("#{RESPONSE_XPATH}/getPrioritiesReturn").map {
|
42
|
-
|frag|
|
43
|
-
JIRA::Priority.priority_with_xml_fragment frag
|
50
|
+
|frag| JIRA::Priority.new_with_xml_fragment frag
|
44
51
|
}
|
45
52
|
end
|
46
53
|
|
@@ -50,8 +57,7 @@ module RemoteAPI
|
|
50
57
|
msg.add 'soap:in0', @auth_token
|
51
58
|
}
|
52
59
|
response.document.xpath("#{RESPONSE_XPATH}/getResolutionsReturn").map {
|
53
|
-
|frag|
|
54
|
-
JIRA::Resolution.resolution_with_xml_fragment frag
|
60
|
+
|frag| JIRA::Resolution.new_with_xml_fragment frag
|
55
61
|
}
|
56
62
|
end
|
57
63
|
|
@@ -61,8 +67,7 @@ module RemoteAPI
|
|
61
67
|
msg.add 'soap:in0', @auth_token
|
62
68
|
}
|
63
69
|
response.document.xpath("#{RESPONSE_XPATH}/getCustomFieldsReturn").map {
|
64
|
-
|frag|
|
65
|
-
JIRA::Field.field_with_xml_fragment frag
|
70
|
+
|frag| JIRA::Field.new_with_xml_fragment frag
|
66
71
|
}
|
67
72
|
end
|
68
73
|
|
@@ -72,8 +77,7 @@ module RemoteAPI
|
|
72
77
|
msg.add 'soap:in0', @auth_token
|
73
78
|
}
|
74
79
|
response.document.xpath("#{RESPONSE_XPATH}/getIssueTypesReturn").map {
|
75
|
-
|frag|
|
76
|
-
JIRA::IssueType.issue_type_with_xml_fragment frag
|
80
|
+
|frag| JIRA::IssueType.new_with_xml_fragment frag
|
77
81
|
}
|
78
82
|
end
|
79
83
|
|
@@ -83,19 +87,17 @@ module RemoteAPI
|
|
83
87
|
msg.add 'soap:in0', @auth_token
|
84
88
|
}
|
85
89
|
response.document.xpath("#{RESPONSE_XPATH}/getStatusesReturn").map {
|
86
|
-
|frag|
|
87
|
-
JIRA::Status.status_with_xml_fragment frag
|
90
|
+
|frag| JIRA::Status.new_with_xml_fragment frag
|
88
91
|
}
|
89
92
|
end
|
90
93
|
|
91
|
-
# @return [[JIRA::
|
94
|
+
# @return [[JIRA::NotificationScheme]]
|
92
95
|
def get_notification_schemes
|
93
96
|
response = invoke('soap:getNotificationSchemes') { |msg|
|
94
97
|
msg.add 'soap:in0', @auth_token
|
95
98
|
}
|
96
99
|
response.document.xpath("#{RESPONSE_XPATH}/getNotificationSchemesReturn").map {
|
97
|
-
|frag|
|
98
|
-
JIRA::Scheme.scheme_with_xml_fragment frag
|
100
|
+
|frag| JIRA::NotificationScheme.new_with_xml_fragment frag
|
99
101
|
}
|
100
102
|
end
|
101
103
|
|
@@ -107,11 +109,13 @@ module RemoteAPI
|
|
107
109
|
msg.add 'soap:in1', project_key
|
108
110
|
}
|
109
111
|
response.document.xpath("#{RESPONSE_XPATH}/getVersionsReturn").map {
|
110
|
-
|frag|
|
111
|
-
JIRA::Version.version_with_xml_fragment frag
|
112
|
+
|frag| JIRA::Version.new_with_xml_fragment frag
|
112
113
|
}
|
113
114
|
end
|
114
115
|
|
116
|
+
# You need to explicitly ask for schemes in order to get them. By
|
117
|
+
# default, most project fetching methods purposely leave out all
|
118
|
+
# the scheme information as permission schemes can be very large.
|
115
119
|
# @param [String] project_key
|
116
120
|
# @return [JIRA::Project]
|
117
121
|
def get_project_with_key(project_key)
|
@@ -119,8 +123,7 @@ module RemoteAPI
|
|
119
123
|
msg.add 'soap:in0', @auth_token
|
120
124
|
msg.add 'soap:in1', project_key
|
121
125
|
}
|
122
|
-
|
123
|
-
JIRA::Project.project_with_xml_fragment frag
|
126
|
+
JIRA::Project.new_with_xml_fragment response.document.xpath('//getProjectByKeyReturn').first
|
124
127
|
end
|
125
128
|
|
126
129
|
# @param [String] user_name
|
@@ -130,7 +133,7 @@ module RemoteAPI
|
|
130
133
|
msg.add 'soap:in0', @auth_token
|
131
134
|
msg.add 'soap:in1', user_name
|
132
135
|
}
|
133
|
-
JIRA::User.
|
136
|
+
JIRA::User.new_with_xml_fragment response.document.xpath('//getUserReturn').first
|
134
137
|
end
|
135
138
|
|
136
139
|
# Gets you the default avatar image for a project; if you want all
|
@@ -142,11 +145,11 @@ module RemoteAPI
|
|
142
145
|
msg.add 'soap:in0', @auth_token
|
143
146
|
msg.add 'soap:in1', project_key
|
144
147
|
}
|
145
|
-
JIRA::Avatar.
|
148
|
+
JIRA::Avatar.new_with_xml_fragment response.document.xpath('//getProjectAvatarReturn').first
|
146
149
|
end
|
147
150
|
|
148
|
-
# Gets ALL avatars for a given project
|
149
|
-
# just want the
|
151
|
+
# Gets ALL avatars for a given project with this method; if you
|
152
|
+
# just want the project avatar, use {#get_project_avatar_for_key}.
|
150
153
|
# @param [String] project_key
|
151
154
|
# @param [boolean] include_default_avatars
|
152
155
|
# @return [[JIRA::Avatar]]
|
@@ -157,8 +160,7 @@ module RemoteAPI
|
|
157
160
|
msg.add 'soap:in2', include_default_avatars
|
158
161
|
}
|
159
162
|
response.document.xpath("#{RESPONSE_XPATH}/getProjectAvatarsReturn").map {
|
160
|
-
|frag|
|
161
|
-
JIRA::Avatar.avatar_with_xml_fragment frag
|
163
|
+
|frag| JIRA::Avatar.new_with_xml_fragment frag
|
162
164
|
}
|
163
165
|
end
|
164
166
|
|
@@ -181,29 +183,27 @@ module RemoteAPI
|
|
181
183
|
msg.add 'soap:in2', max_results
|
182
184
|
}
|
183
185
|
response.document.xpath("#{RESPONSE_XPATH}/getIssuesFromJqlSearchReturn").map {
|
184
|
-
|frag|
|
185
|
-
JIRA::Issue.issue_with_xml_fragment frag
|
186
|
+
|frag| JIRA::Issue.new_with_xml_fragment frag
|
186
187
|
}
|
187
188
|
end
|
188
189
|
|
189
|
-
# This method can update most, but not all, issue fields.
|
190
|
+
# This method can update most, but not all, issue fields. Some limitations
|
191
|
+
# are because of how the API is designed, and some are because I have not
|
192
|
+
# yet implemented the ability to update fields made of custom objects (things
|
193
|
+
# in the JIRA module).
|
190
194
|
#
|
191
195
|
# Fields known to not update via this method:
|
192
196
|
# - status - use {#progress_workflow_action}
|
193
|
-
# - attachments - use {#
|
197
|
+
# - attachments - use {#add_base64_encoded_attachments_to_issue_with_key}
|
194
198
|
#
|
195
199
|
# Though JIRA::FieldValue objects have an id field, they do not expect to be
|
196
200
|
# given id values. You must use the name of the field you wish to update.
|
197
201
|
# @example Usage With A Normal Field
|
198
|
-
# summary = JIRA::FieldValue.new
|
199
|
-
# summary.id = 'summary'
|
200
|
-
# summary.values = ['My new summary']
|
202
|
+
# summary = JIRA::FieldValue.new 'summary', ['My new summary']
|
201
203
|
# @example Usage With A Custom Field
|
202
|
-
# custom_field = JIRA::FieldValue.new
|
203
|
-
# custom_field.id = 'customfield_10060'
|
204
|
-
# custom_field.values = ['123456']
|
204
|
+
# custom_field = JIRA::FieldValue.new 'customfield_10060', ['123456']
|
205
205
|
# @example Setting a field to be blank/nil
|
206
|
-
# description = JIRA::FieldValue.
|
206
|
+
# description = JIRA::FieldValue.new 'description'
|
207
207
|
# @example Calling the method to update an issue
|
208
208
|
# jira_service_instance.update_issue 'PROJECT-1', description, custom_field
|
209
209
|
# @param [String] issue_key
|
@@ -217,8 +217,7 @@ module RemoteAPI
|
|
217
217
|
field_values.each { |fv| fv.soapify_for submsg }
|
218
218
|
end
|
219
219
|
}
|
220
|
-
|
221
|
-
JIRA::Issue.issue_with_xml_fragment frag
|
220
|
+
JIRA::Issue.new_with_xml_fragment response.document.xpath('//updateIssueReturn').first
|
222
221
|
end
|
223
222
|
|
224
223
|
# Some fields will be ignored when an issue is created.
|
@@ -238,8 +237,7 @@ module RemoteAPI
|
|
238
237
|
issue.soapify_for submsg
|
239
238
|
end
|
240
239
|
}
|
241
|
-
|
242
|
-
JIRA::Issue.issue_with_xml_fragment frag
|
240
|
+
JIRA::Issue.new_with_xml_fragment response.document.xpath('//createIssueReturn').first
|
243
241
|
end
|
244
242
|
|
245
243
|
# @param [String] issue_key
|
@@ -249,8 +247,7 @@ module RemoteAPI
|
|
249
247
|
msg.add 'soap:in0', @auth_token
|
250
248
|
msg.add 'soap:in1', issue_key
|
251
249
|
}
|
252
|
-
|
253
|
-
JIRA::Issue.issue_with_xml_fragment frag
|
250
|
+
JIRA::Issue.new_with_xml_fragment response.document.xpath('//getIssueReturn').first
|
254
251
|
end
|
255
252
|
|
256
253
|
# @param [String] issue_id
|
@@ -260,8 +257,7 @@ module RemoteAPI
|
|
260
257
|
msg.add 'soap:in0', @auth_token
|
261
258
|
msg.add 'soap:in1', issue_id
|
262
259
|
}
|
263
|
-
|
264
|
-
JIRA::Issue.issue_with_xml_fragment frag
|
260
|
+
JIRA::Issue.new_with_xml_fragment response.document.xpath('//getIssueByIdReturn').first
|
265
261
|
end
|
266
262
|
|
267
263
|
# @param [String] issue_key
|
@@ -272,8 +268,7 @@ module RemoteAPI
|
|
272
268
|
msg.add 'soap:in1', issue_key
|
273
269
|
}
|
274
270
|
response.document.xpath("#{RESPONSE_XPATH}/getAttachmentsFromIssueReturn").map {
|
275
|
-
|frag|
|
276
|
-
JIRA::AttachmentMetadata.attachment_with_xml_fragment frag
|
271
|
+
|frag| JIRA::AttachmentMetadata.new_with_xml_fragment frag
|
277
272
|
}
|
278
273
|
end
|
279
274
|
|
@@ -289,14 +284,13 @@ module RemoteAPI
|
|
289
284
|
# @param [String] project_key
|
290
285
|
# @param [JIRA::Version] version
|
291
286
|
# @return [JIRA::Version]
|
292
|
-
def
|
287
|
+
def add_version_to_project_with_key(project_key, version)
|
293
288
|
response = invoke('soap:addVersion') { |msg|
|
294
289
|
msg.add 'soap:in0', @auth_token
|
295
290
|
msg.add 'soap:in1', project_key
|
296
291
|
msg.add 'soap:in2' do |submsg| version.soapify_for submsg end
|
297
292
|
}
|
298
|
-
|
299
|
-
JIRA::Version.version_with_xml_fragment frag
|
293
|
+
JIRA::Version.new_with_xml_fragment response.document.xpath('//addVersionReturn').first
|
300
294
|
end
|
301
295
|
|
302
296
|
# The archive state can only be set to true for versions that have not been
|
@@ -326,8 +320,7 @@ module RemoteAPI
|
|
326
320
|
msg.add 'soap:in0', @auth_token
|
327
321
|
msg.add 'soap:in1' do |submsg| project.soapify_for submsg end
|
328
322
|
}
|
329
|
-
|
330
|
-
JIRA::Project.project_with_xml_fragment frag
|
323
|
+
JIRA::Project.new_with_xml_fragment response.document.xpath('//createProjectFromObjectReturn').first
|
331
324
|
end
|
332
325
|
|
333
326
|
# You can set the release state for a project with this method.
|
@@ -352,8 +345,7 @@ module RemoteAPI
|
|
352
345
|
msg.add 'soap:in0', @auth_token
|
353
346
|
msg.add 'soap:in1' do |submsg| project.soapify_for submsg end
|
354
347
|
}
|
355
|
-
|
356
|
-
JIRA::Project.project_with_xml_fragment frag
|
348
|
+
JIRA::Project.new_with_xml_fragment response.document.xpath('//updateProjectReturn').first
|
357
349
|
end
|
358
350
|
|
359
351
|
# It seems that creating a user without any permission groups will trigger
|
@@ -374,8 +366,7 @@ module RemoteAPI
|
|
374
366
|
msg.add 'soap:in3', full_name
|
375
367
|
msg.add 'soap:in4', email
|
376
368
|
}
|
377
|
-
|
378
|
-
JIRA::User.user_with_xml_fragment frag
|
369
|
+
JIRA::User.new_with_xml_fragment response.document.xpath('//createUserReturn').first
|
379
370
|
end
|
380
371
|
|
381
372
|
# @param [String] username
|
@@ -395,8 +386,7 @@ module RemoteAPI
|
|
395
386
|
msg.add 'soap:in0', @auth_token
|
396
387
|
msg.add 'soap:in1', project_id
|
397
388
|
}
|
398
|
-
|
399
|
-
JIRA::Project.project_with_xml_fragment frag
|
389
|
+
JIRA::Project.new_with_xml_fragment response.document.xpath('//getProjectByIdReturn').first
|
400
390
|
end
|
401
391
|
|
402
392
|
# @todo parse the permission scheme
|
@@ -408,8 +398,7 @@ module RemoteAPI
|
|
408
398
|
msg.add 'soap:in0', @auth_token
|
409
399
|
msg.add 'soap:in1', project_id
|
410
400
|
}
|
411
|
-
|
412
|
-
JIRA::Project.project_with_xml_fragment frag
|
401
|
+
JIRA::Project.new_with_xml_fragment response.document.xpath('//getProjectWithSchemesByIdReturn').first
|
413
402
|
end
|
414
403
|
|
415
404
|
# @param [String] issue_key
|
@@ -431,8 +420,7 @@ module RemoteAPI
|
|
431
420
|
msg.add 'soap:in0', @auth_token
|
432
421
|
msg.add 'soap:in1', id
|
433
422
|
}
|
434
|
-
|
435
|
-
JIRA::Comment.comment_with_xml_fragment frag
|
423
|
+
JIRA::Comment.new_with_xml_fragment response.document.xpath('//getCommentReturn').first
|
436
424
|
end
|
437
425
|
|
438
426
|
# @param [String] issue_key
|
@@ -443,8 +431,7 @@ module RemoteAPI
|
|
443
431
|
msg.add 'soap:in1', issue_key
|
444
432
|
}
|
445
433
|
response.document.xpath("#{RESPONSE_XPATH}/getCommentsReturn").map {
|
446
|
-
|frag|
|
447
|
-
JIRA::Comment.comment_with_xml_fragment frag
|
434
|
+
|frag| JIRA::Comment.new_with_xml_fragment frag
|
448
435
|
}
|
449
436
|
end
|
450
437
|
|
@@ -456,8 +443,7 @@ module RemoteAPI
|
|
456
443
|
msg.add 'soap:in1', project_id
|
457
444
|
}
|
458
445
|
response.document.xpath("#{RESPONSE_XPATH}/getIssueTypesForProjectReturn").map {
|
459
|
-
|frag|
|
460
|
-
JIRA::IssueType.issue_type_with_xml_fragment frag
|
446
|
+
|frag| JIRA::IssueType.new_with_xml_fragment frag
|
461
447
|
}
|
462
448
|
end
|
463
449
|
|
@@ -475,8 +461,7 @@ module RemoteAPI
|
|
475
461
|
msg.add 'soap:in3', max_results
|
476
462
|
}
|
477
463
|
response.document.xpath("#{RESPONSE_XPATH}/getIssuesFromTextSearchWithLimitReturn").map {
|
478
|
-
|frag|
|
479
|
-
JIRA::Issue.issue_with_xml_fragment frag
|
464
|
+
|frag| JIRA::Issue.new_with_xml_fragment frag
|
480
465
|
}
|
481
466
|
end
|
482
467
|
|
@@ -487,8 +472,8 @@ module RemoteAPI
|
|
487
472
|
msg.add 'soap:in0', @auth_token
|
488
473
|
msg.add 'soap:in1' do |submsg| comment.soapify_for submsg end
|
489
474
|
}
|
490
|
-
frag = response.document.xpath
|
491
|
-
JIRA::Comment.
|
475
|
+
frag = response.document.xpath('//editCommentReturn').first
|
476
|
+
JIRA::Comment.new_with_xml_fragment frag
|
492
477
|
end
|
493
478
|
|
494
479
|
# @return [[JIRA::IssueType]]
|
@@ -497,8 +482,7 @@ module RemoteAPI
|
|
497
482
|
msg.add 'soap:in0', @auth_token
|
498
483
|
}
|
499
484
|
response.document.xpath("#{RESPONSE_XPATH}/getSubTaskIssueTypesReturn").map {
|
500
|
-
|frag|
|
501
|
-
JIRA::IssueType.issue_type_with_xml_fragment frag
|
485
|
+
|frag| JIRA::IssueType.new_with_xml_fragment frag
|
502
486
|
}
|
503
487
|
end
|
504
488
|
|
@@ -510,8 +494,7 @@ module RemoteAPI
|
|
510
494
|
msg.add 'soap:in1', project_id
|
511
495
|
}
|
512
496
|
response.document.xpath("#{RESPONSE_XPATH}/getSubtaskIssueTypesForProjectReturn").map {
|
513
|
-
|frag|
|
514
|
-
JIRA::IssueType.issue_type_with_xml_fragment frag
|
497
|
+
|frag| JIRA::IssueType.new_with_xml_fragment frag
|
515
498
|
}
|
516
499
|
end
|
517
500
|
|
@@ -532,8 +515,7 @@ module RemoteAPI
|
|
532
515
|
msg.add 'soap:in0', @auth_token
|
533
516
|
}
|
534
517
|
response.document.xpath("#{RESPONSE_XPATH}/getFavouriteFiltersReturn").map {
|
535
|
-
|frag|
|
536
|
-
JIRA::Filter.filter_with_xml_fragment frag
|
518
|
+
|frag| JIRA::Filter.new_with_xml_fragment frag
|
537
519
|
}
|
538
520
|
end
|
539
521
|
|
@@ -549,8 +531,7 @@ module RemoteAPI
|
|
549
531
|
msg.add 'soap:in3', max_results
|
550
532
|
}
|
551
533
|
response.document.xpath("#{RESPONSE_XPATH}/getIssuesFromFilterWithLimitReturn").map {
|
552
|
-
|frag|
|
553
|
-
JIRA::Issue.issue_with_xml_fragment frag
|
534
|
+
|frag| JIRA::Issue.new_with_xml_fragment frag
|
554
535
|
}
|
555
536
|
end
|
556
537
|
|
@@ -561,7 +542,7 @@ module RemoteAPI
|
|
561
542
|
msg.add 'soap:in0', @auth_token
|
562
543
|
msg.add 'soap:in1', id
|
563
544
|
}
|
564
|
-
response.document.xpath('//getIssueCountForFilterReturn').
|
545
|
+
response.document.xpath('//getIssueCountForFilterReturn').to_i
|
565
546
|
end
|
566
547
|
|
567
548
|
# @todo optimize building the message, try a single pass
|
@@ -590,15 +571,14 @@ module RemoteAPI
|
|
590
571
|
response = invoke('soap:getServerInfo') { |msg|
|
591
572
|
msg.add 'soap:in0', @auth_token
|
592
573
|
}
|
593
|
-
|
594
|
-
JIRA::ServerInfo.server_info_with_xml_fragment frag
|
574
|
+
JIRA::ServerInfo.new_with_xml_fragment response.document.xpath('//getServerInfoReturn').first
|
595
575
|
end
|
596
|
-
end
|
597
576
|
|
598
|
-
#
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
577
|
+
# @return [JIRA::ServerConfiguration]
|
578
|
+
def get_server_configuration
|
579
|
+
response = invoke('soap:getConfiguration') { |msg|
|
580
|
+
msg.add 'soap:in0', @auth_token
|
581
|
+
}
|
582
|
+
JIRA::ServerConfiguration.new_with_xml_fragment response.document.xpath('//getConfigurationReturn').first
|
583
|
+
end
|
584
|
+
end
|