jiraSOAP 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +11 -1
- data/Rakefile +10 -6
- data/docs/Examples.markdown +16 -1
- data/lib/jiraSOAP.rb +23 -1
- data/lib/jiraSOAP/api.rb +22 -23
- data/lib/jiraSOAP/api/additions.rb +3 -5
- data/lib/jiraSOAP/api/attachments.rb +2 -11
- data/lib/jiraSOAP/api/avatars.rb +5 -5
- data/lib/jiraSOAP/api/comments.rb +2 -2
- data/lib/jiraSOAP/api/filters.rb +3 -3
- data/lib/jiraSOAP/api/issue_data_types.rb +8 -8
- data/lib/jiraSOAP/api/issues.rb +56 -19
- data/lib/jiraSOAP/api/project_roles.rb +2 -2
- data/lib/jiraSOAP/api/projects.rb +6 -4
- data/lib/jiraSOAP/api/schemes.rb +2 -2
- data/lib/jiraSOAP/api/server_info.rb +2 -2
- data/lib/jiraSOAP/api/users.rb +2 -2
- data/lib/jiraSOAP/api/versions.rb +1 -1
- data/lib/jiraSOAP/core_extensions.rb +5 -2
- data/lib/jiraSOAP/entities/comment.rb +1 -1
- data/lib/jiraSOAP/entities/custom_field_value.rb +1 -1
- data/lib/jiraSOAP/entities/field_value.rb +1 -1
- data/lib/jiraSOAP/entities/server_configuration.rb +1 -1
- data/lib/jiraSOAP/entities/server_info.rb +1 -1
- data/lib/jiraSOAP/entities/time_info.rb +1 -1
- data/lib/jiraSOAP/entities/version.rb +1 -1
- data/lib/jiraSOAP/jira_service.rb +0 -12
- data/lib/jiraSOAP/url.rb +4 -0
- data/lib/jiraSOAP/version.rb +2 -1
- data/test/progressWorkflowActionTest.rb +8 -0
- metadata +21 -23
data/ChangeLog
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
+
Version 0.9.0
|
2
|
+
|
3
|
+
* Deprecate RemoteAPI#get_projects_without_schemes in favour of #projects
|
4
|
+
* Properly deprecate #get_ methods
|
5
|
+
* Add RemoteAPI#progress_workflow_action (thanks Lucas Jourdes)
|
6
|
+
* Add RemoteAPI#available_action (thanks Lucas Jourdes)
|
7
|
+
* Add extra documentation about updating fields (thanks Vincent Beau)
|
8
|
+
|
9
|
+
* Various small documentation updates and tweaks
|
10
|
+
|
1
11
|
Version 0.8.6
|
2
12
|
|
3
|
-
* Add extra documentation about updating cascading fields (thanks Lucas)
|
13
|
+
* Add extra documentation about updating cascading fields (thanks Lucas Jourdes)
|
4
14
|
|
5
15
|
Version 0.8.5
|
6
16
|
|
data/Rakefile
CHANGED
@@ -22,11 +22,8 @@ end
|
|
22
22
|
### GEM STUFF
|
23
23
|
|
24
24
|
require 'rake/gempackagetask'
|
25
|
-
spec = Gem::Specification.load
|
26
|
-
Rake::GemPackageTask.new(spec)
|
27
|
-
pkg.need_zip = false
|
28
|
-
pkg.need_tar = true
|
29
|
-
end
|
25
|
+
spec = Gem::Specification.load 'jiraSOAP.gemspec'
|
26
|
+
Rake::GemPackageTask.new(spec) { }
|
30
27
|
|
31
28
|
require 'rubygems/dependency_installer'
|
32
29
|
desc 'Build the gem and install it'
|
@@ -41,7 +38,7 @@ require 'rake/testtask'
|
|
41
38
|
Rake::TestTask.new(:test) do |t|
|
42
39
|
t.libs << 'test'
|
43
40
|
t.pattern = 'test/**/test_*.rb'
|
44
|
-
t.ruby_opts = ['-rhelper']
|
41
|
+
t.ruby_opts = ['-rhelper.rb']
|
45
42
|
t.verbose = true
|
46
43
|
end
|
47
44
|
|
@@ -52,3 +49,10 @@ end
|
|
52
49
|
|
53
50
|
|
54
51
|
### DOCUMENTATION
|
52
|
+
|
53
|
+
begin
|
54
|
+
require 'yard'
|
55
|
+
YARD::Rake::YardocTask.new
|
56
|
+
rescue LoadError => e
|
57
|
+
warn 'yard not available. Install it with: gem install yard'
|
58
|
+
end
|
data/docs/Examples.markdown
CHANGED
@@ -86,7 +86,22 @@ documentation as well ({JIRA::RemoteAPI#update_issue}).
|
|
86
86
|
|
87
87
|
summary = JIRA::FieldValue.new('summary', 'new summary info from jiraSOAP')
|
88
88
|
jira.update_issue issue.key, summary
|
89
|
-
puts "Updated issue #{issue.key}'s field #{summary.
|
89
|
+
puts "Updated issue #{issue.key}'s field #{summary.field_name}\n"
|
90
|
+
|
91
|
+
One caveat is that some fields cannot be updated without also
|
92
|
+
progressing the issue to a new status.
|
93
|
+
|
94
|
+
action = jira.available_actions('TST-14').find do |action|
|
95
|
+
action.name == 'Send To Test'
|
96
|
+
end
|
97
|
+
|
98
|
+
jira.progress_workflow_action 'TST-14', action.id
|
99
|
+
|
100
|
+
You can also update fields, when progressing an issue to a new
|
101
|
+
workflow state.
|
102
|
+
|
103
|
+
assignee = JIRA::FieldValue.new 'assignee', 'mrada'
|
104
|
+
jira.progress_workflow_action 'TST-14', action.id, assignee
|
90
105
|
|
91
106
|
## User Information
|
92
107
|
|
data/lib/jiraSOAP.rb
CHANGED
@@ -13,10 +13,32 @@ require 'jiraSOAP/macruby_extensions' if RUBY_ENGINE == 'macruby'
|
|
13
13
|
|
14
14
|
##
|
15
15
|
# All the remote entities as well as the SOAP service client.
|
16
|
-
module JIRA
|
16
|
+
module JIRA; end
|
17
|
+
|
18
|
+
##
|
19
|
+
# Inspired by Gem::Deprecate from rubygems. A mixin that exposes a
|
20
|
+
# method to declare deprecated methods.
|
21
|
+
module JIRA::Deprecate
|
22
|
+
|
23
|
+
##
|
24
|
+
# Deprecate a method that begins with `get_` by printing out a
|
25
|
+
# message and then calling the original method.
|
26
|
+
#
|
27
|
+
# @param [Symbol] name
|
28
|
+
def deprecate name
|
29
|
+
define_method "get_#{name}" do |*args|
|
30
|
+
$stderr.puts <<-EOM
|
31
|
+
RemoteAPI#get_#{name} is deprecated and will be removed in the next release.
|
32
|
+
Please use RemoteAPI#{name} instead.
|
33
|
+
EOM
|
34
|
+
send name, *args
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
17
38
|
end
|
18
39
|
|
19
40
|
require 'jiraSOAP/version'
|
41
|
+
require 'jiraSOAP/core_extensions'
|
20
42
|
require 'jiraSOAP/entities'
|
21
43
|
require 'jiraSOAP/api'
|
22
44
|
require 'jiraSOAP/jira_service'
|
data/lib/jiraSOAP/api.rb
CHANGED
@@ -1,28 +1,12 @@
|
|
1
|
-
require 'jiraSOAP/api/additions'
|
2
|
-
require 'jiraSOAP/api/attachments'
|
3
|
-
require 'jiraSOAP/api/avatars'
|
4
|
-
require 'jiraSOAP/api/comments'
|
5
|
-
require 'jiraSOAP/api/filters'
|
6
|
-
require 'jiraSOAP/api/issue_data_types'
|
7
|
-
require 'jiraSOAP/api/issues'
|
8
|
-
require 'jiraSOAP/api/project_roles'
|
9
|
-
require 'jiraSOAP/api/projects'
|
10
|
-
require 'jiraSOAP/api/schemes'
|
11
|
-
require 'jiraSOAP/api/server_info'
|
12
|
-
require 'jiraSOAP/api/users'
|
13
|
-
require 'jiraSOAP/api/versions'
|
14
|
-
require 'jiraSOAP/api/worklog'
|
15
|
-
|
16
1
|
##
|
17
|
-
# @todo progressWorkflowAction and friends
|
18
|
-
# @todo monkey patch Array to include a #to_soap method
|
19
|
-
#
|
20
2
|
# Contains the API defined by Atlassian for the [JIRA SOAP service](http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/com/atlassian/jira/rpc/soap/JiraSoapService.html).
|
21
3
|
#
|
22
4
|
# There are several cases where this API diverges from the one defined by
|
23
5
|
# Atlassian; most notably, this API tries to be more idomatically Ruby by using
|
24
6
|
# snake case for method names, default values, varargs, etc..
|
25
7
|
module JIRA::RemoteAPI
|
8
|
+
extend JIRA::Deprecate
|
9
|
+
|
26
10
|
|
27
11
|
# @group Logging in/out
|
28
12
|
|
@@ -59,7 +43,6 @@ module JIRA::RemoteAPI
|
|
59
43
|
|
60
44
|
##
|
61
45
|
# @todo make this method less ugly
|
62
|
-
# @todo handle arrays of strings
|
63
46
|
#
|
64
47
|
# A generic method for calling a SOAP method and soapifying all
|
65
48
|
# the arguments.
|
@@ -72,8 +55,8 @@ module JIRA::RemoteAPI
|
|
72
55
|
invoke "soap:#{method}" do |msg|
|
73
56
|
for i in 0...args.size
|
74
57
|
case arg = args.shift
|
75
|
-
when JIRA::Entity
|
76
|
-
msg.add "soap:in#{i}"
|
58
|
+
when JIRA::Entity, Array
|
59
|
+
msg.add "soap:in#{i}" do |submsg| arg.soapify_for submsg end
|
77
60
|
else
|
78
61
|
msg.add "soap:in#{i}", arg
|
79
62
|
end
|
@@ -99,7 +82,7 @@ module JIRA::RemoteAPI
|
|
99
82
|
end
|
100
83
|
|
101
84
|
##
|
102
|
-
# A more complex form of {#
|
85
|
+
# A more complex form of {#jira_call} that does a little more work for
|
103
86
|
# you when you need to build an array of return values.
|
104
87
|
#
|
105
88
|
# @param [String] method name of the JIRA SOAP API method
|
@@ -108,7 +91,23 @@ module JIRA::RemoteAPI
|
|
108
91
|
# @return [Nokogiri::XML::NodeSet]
|
109
92
|
def array_jira_call type, method, *args
|
110
93
|
response = soap_call method, self.auth_token, *args
|
111
|
-
response.xpath(
|
94
|
+
response.xpath('node()').map { |frag| type.new_with_xml(frag) }
|
112
95
|
end
|
113
96
|
|
114
97
|
end
|
98
|
+
|
99
|
+
|
100
|
+
require 'jiraSOAP/api/additions'
|
101
|
+
require 'jiraSOAP/api/attachments'
|
102
|
+
require 'jiraSOAP/api/avatars'
|
103
|
+
require 'jiraSOAP/api/comments'
|
104
|
+
require 'jiraSOAP/api/filters'
|
105
|
+
require 'jiraSOAP/api/issue_data_types'
|
106
|
+
require 'jiraSOAP/api/issues'
|
107
|
+
require 'jiraSOAP/api/project_roles'
|
108
|
+
require 'jiraSOAP/api/projects'
|
109
|
+
require 'jiraSOAP/api/schemes'
|
110
|
+
require 'jiraSOAP/api/server_info'
|
111
|
+
require 'jiraSOAP/api/users'
|
112
|
+
require 'jiraSOAP/api/versions'
|
113
|
+
require 'jiraSOAP/api/worklog'
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# SOAP API javadoc. They are generally close to something from the javadoc
|
4
4
|
# but with some extra conveniences.
|
5
5
|
module JIRA::RemoteAPIAdditions
|
6
|
+
extend JIRA::Deprecate
|
6
7
|
|
7
8
|
##
|
8
9
|
# Returns the first field that exactly matches the given
|
@@ -11,11 +12,8 @@ module JIRA::RemoteAPIAdditions
|
|
11
12
|
# @param [String] name
|
12
13
|
# @return [JIRA::Field,nil]
|
13
14
|
def custom_field_with_name name
|
14
|
-
get_custom_fields.
|
15
|
-
return cf if cf.name == name
|
16
|
-
}
|
17
|
-
nil
|
15
|
+
get_custom_fields.find { |cf| cf.name == name }
|
18
16
|
end
|
19
|
-
|
17
|
+
deprecate :custom_field_with_name
|
20
18
|
|
21
19
|
end
|
@@ -17,7 +17,7 @@ module JIRA::RemoteAPI
|
|
17
17
|
def attachments_for_issue_with_key issue_key
|
18
18
|
array_jira_call JIRA::AttachmentMetadata, 'getAttachmentsFromIssue', issue_key
|
19
19
|
end
|
20
|
-
|
20
|
+
deprecate :attachments_for_issue_with_key
|
21
21
|
|
22
22
|
##
|
23
23
|
# Expect this method to be slow.
|
@@ -27,16 +27,7 @@ module JIRA::RemoteAPI
|
|
27
27
|
# @param [Array<String>] data base64 encoded data
|
28
28
|
# @return [Boolean] true if successful
|
29
29
|
def add_base64_encoded_attachments_to_issue_with_key issue_key, filenames, data
|
30
|
-
|
31
|
-
msg.add 'soap:in0', self.auth_token
|
32
|
-
msg.add 'soap:in1', issue_key
|
33
|
-
msg.add 'soap:in2' do |submsg|
|
34
|
-
filenames.each { |filename| submsg.add 'filenames', filename }
|
35
|
-
end
|
36
|
-
msg.add 'soap:in3' do |submsg|
|
37
|
-
data.each { |datum| submsg.add 'base64EncodedData', datum }
|
38
|
-
end
|
39
|
-
}
|
30
|
+
jira_call 'addBase64EncodedAttachmentsToIssue', issue_key, filenames, data
|
40
31
|
true
|
41
32
|
end
|
42
33
|
|
data/lib/jiraSOAP/api/avatars.rb
CHANGED
@@ -4,18 +4,18 @@ module JIRA::RemoteAPI
|
|
4
4
|
|
5
5
|
##
|
6
6
|
# Gets you the default avatar image for a project; if you want all
|
7
|
-
# the avatars for a project, use {#
|
7
|
+
# the avatars for a project, use {#project_avatars_for_key}.
|
8
8
|
#
|
9
9
|
# @param [String] project_key
|
10
10
|
# @return [JIRA::Avatar]
|
11
11
|
def project_avatar_for_key project_key
|
12
|
-
JIRA::Avatar.new_with_xml jira_call(
|
12
|
+
JIRA::Avatar.new_with_xml jira_call('getProjectAvatar', project_key)
|
13
13
|
end
|
14
|
-
|
14
|
+
deprecate :project_avatar_for_key
|
15
15
|
|
16
16
|
##
|
17
17
|
# Gets ALL avatars for a given project with this method; if you
|
18
|
-
# just want the project avatar, use {#
|
18
|
+
# just want the project avatar, use {#project_avatar_for_key}.
|
19
19
|
#
|
20
20
|
# @param [String] project_key
|
21
21
|
# @param [Boolean] include_default_avatars
|
@@ -23,7 +23,7 @@ module JIRA::RemoteAPI
|
|
23
23
|
def project_avatars_for_key project_key, include_default_avatars = false
|
24
24
|
array_jira_call JIRA::Avatar, 'getProjectAvatars', project_key, include_default_avatars
|
25
25
|
end
|
26
|
-
|
26
|
+
deprecate :project_avatars_for_key
|
27
27
|
|
28
28
|
##
|
29
29
|
# @note You cannot delete system avatars, and you need project
|
@@ -15,14 +15,14 @@ module JIRA::RemoteAPI
|
|
15
15
|
def comment_with_id id
|
16
16
|
JIRA::Comment.new_with_xml jira_call( 'getComment', id )
|
17
17
|
end
|
18
|
-
|
18
|
+
deprecate :comment_with_id
|
19
19
|
|
20
20
|
# @param [String] issue_key
|
21
21
|
# @return [Array<JIRA::Comment>]
|
22
22
|
def comments_for_issue_with_key issue_key
|
23
23
|
array_jira_call JIRA::Comment, 'getComments', issue_key
|
24
24
|
end
|
25
|
-
|
25
|
+
deprecate :comments_for_issue_with_key
|
26
26
|
|
27
27
|
# @param [JIRA::Comment] comment
|
28
28
|
# @return [JIRA::Comment]
|
data/lib/jiraSOAP/api/filters.rb
CHANGED
@@ -9,15 +9,15 @@ module JIRA::RemoteAPI
|
|
9
9
|
def favourite_filters
|
10
10
|
array_jira_call JIRA::Filter, 'getFavouriteFilters'
|
11
11
|
end
|
12
|
-
alias_method :get_favourite_filters, :favourite_filters
|
13
|
-
alias_method :get_favorite_filters, :favourite_filters
|
14
12
|
alias_method :favorite_filters, :favourite_filters
|
13
|
+
deprecate :favorite_filters
|
14
|
+
deprecate :favourite_filters
|
15
15
|
|
16
16
|
# @param [String] id
|
17
17
|
# @return [Fixnum]
|
18
18
|
def issue_count_for_filter_with_id id
|
19
19
|
jira_call( 'getIssueCountForFilter', id ).to_i
|
20
20
|
end
|
21
|
-
|
21
|
+
deprecate :issue_count_for_filter_with_id
|
22
22
|
|
23
23
|
end
|
@@ -6,51 +6,51 @@ module JIRA::RemoteAPI
|
|
6
6
|
def priorities
|
7
7
|
array_jira_call JIRA::Priority, 'getPriorities'
|
8
8
|
end
|
9
|
-
|
9
|
+
deprecate :priorities
|
10
10
|
|
11
11
|
# @return [Array<JIRA::Resolution>]
|
12
12
|
def resolutions
|
13
13
|
array_jira_call JIRA::Resolution, 'getResolutions'
|
14
14
|
end
|
15
|
-
|
15
|
+
deprecate :resolutions
|
16
16
|
|
17
17
|
# @return [Array<JIRA::Field>]
|
18
18
|
def custom_fields
|
19
19
|
array_jira_call JIRA::Field, 'getCustomFields'
|
20
20
|
end
|
21
|
-
|
21
|
+
deprecate :custom_fields
|
22
22
|
|
23
23
|
# @return [Array<JIRA::IssueType>]
|
24
24
|
def issue_types
|
25
25
|
array_jira_call JIRA::IssueType, 'getIssueTypes'
|
26
26
|
end
|
27
|
-
|
27
|
+
deprecate :issue_types
|
28
28
|
|
29
29
|
# @param [String] project_name
|
30
30
|
# @return [Array<JIRA::IssueType>]
|
31
31
|
def issue_types_for_project_with_id project_id
|
32
32
|
array_jira_call JIRA::IssueType, 'getIssueTypesForProject', project_id
|
33
33
|
end
|
34
|
-
|
34
|
+
deprecate :issue_types_for_project_with_id
|
35
35
|
|
36
36
|
# @return [Array<JIRA::Status>]
|
37
37
|
def statuses
|
38
38
|
array_jira_call JIRA::Status, 'getStatuses'
|
39
39
|
end
|
40
|
-
|
40
|
+
deprecate :statuses
|
41
41
|
|
42
42
|
# @return [Array<JIRA::IssueType>]
|
43
43
|
def subtask_issue_types
|
44
44
|
array_jira_call JIRA::IssueType, 'getSubTaskIssueTypes'
|
45
45
|
end
|
46
|
-
|
46
|
+
deprecate :subtask_issue_types
|
47
47
|
|
48
48
|
# @param [String] project_id
|
49
49
|
# @return [Array<JIRA::IssueType>]
|
50
50
|
def subtask_issue_types_for_project_with_id project_id
|
51
51
|
array_jira_call JIRA::IssueType, 'getSubTaskIssueTypesForProject', project_id
|
52
52
|
end
|
53
|
-
|
53
|
+
deprecate :subtask_issue_types_for_project_with_id
|
54
54
|
|
55
55
|
##
|
56
56
|
# @todo find out what this method does
|
data/lib/jiraSOAP/api/issues.rb
CHANGED
@@ -20,7 +20,7 @@ module JIRA::RemoteAPI
|
|
20
20
|
def issues_from_jql_search jql_query, max_results = 2000
|
21
21
|
array_jira_call JIRA::Issue, 'getIssuesFromJqlSearch', jql_query, max_results
|
22
22
|
end
|
23
|
-
|
23
|
+
deprecate :issues_from_jql_search
|
24
24
|
|
25
25
|
##
|
26
26
|
# This method can update most, but not all, issue fields. Some limitations
|
@@ -34,10 +34,21 @@ module JIRA::RemoteAPI
|
|
34
34
|
# - attachments - use {#add_base64_encoded_attachments_to_issue_with_key}
|
35
35
|
#
|
36
36
|
# Though {JIRA::FieldValue} objects have an id field, they do not expect
|
37
|
-
# to be given id values. You must use the name of the field you
|
38
|
-
# update
|
37
|
+
# to be given id values. You must use the camel cased name of the field you
|
38
|
+
# wish to update, such as `'fixVersions'` to update the `fix_versions` for
|
39
|
+
# an issue.
|
39
40
|
#
|
40
|
-
#
|
41
|
+
# However, there is at least one exception to the rule; when you wish to
|
42
|
+
# update the affected versions for an issue, you should use `'versions'`
|
43
|
+
# instead of `'affectsVersions'`. You need to be careful about these
|
44
|
+
# cases as it has been reported that JIRA will silently fail to update
|
45
|
+
# fields it does not know about.
|
46
|
+
#
|
47
|
+
# Updating nested fields can be tricky, see the example on cascading
|
48
|
+
# select field's to see how it would be done.
|
49
|
+
#
|
50
|
+
# A final note, some fields only should be passed the id in order to
|
51
|
+
# update them, as shown in the version updating example.
|
41
52
|
#
|
42
53
|
# @example Usage With A Normal Field
|
43
54
|
#
|
@@ -53,26 +64,25 @@ module JIRA::RemoteAPI
|
|
53
64
|
#
|
54
65
|
# @example Calling the method to update an issue
|
55
66
|
#
|
56
|
-
#
|
67
|
+
# jira.update_issue 'PROJECT-1', description, custom_field
|
57
68
|
#
|
58
69
|
# @example Setting the value of a cascading select field
|
59
70
|
#
|
60
71
|
# part1 = JIRA::FieldValue.new 'customfield_10285', 'Main Detail'
|
61
72
|
# part2 = JIRA::FieldValue.new 'customfield_10285:1', 'First Subdetail'
|
62
|
-
#
|
73
|
+
# jira.update_issue 'PROJECT-1', part1, part2
|
74
|
+
#
|
75
|
+
# @example Changing the affected versions for an issue
|
76
|
+
#
|
77
|
+
# version = jira.versions_for_project.find { |x| x.name = 'v1.0beta' }
|
78
|
+
# field = JIRA::FieldValue.new 'versions', version.id
|
79
|
+
# jira.update_issue 'PROJECT-1', field
|
63
80
|
#
|
64
81
|
# @param [String] issue_key
|
65
82
|
# @param [JIRA::FieldValue] *field_values
|
66
83
|
# @return [JIRA::Issue]
|
67
84
|
def update_issue issue_key, *field_values
|
68
|
-
|
69
|
-
msg.add 'soap:in0', self.auth_token
|
70
|
-
msg.add 'soap:in1', issue_key
|
71
|
-
msg.add 'soap:in2' do |submsg|
|
72
|
-
field_values.each { |fv| fv.soapify_for submsg }
|
73
|
-
end
|
74
|
-
}
|
75
|
-
JIRA::Issue.new_with_xml response.document.element.xpath('//updateIssueReturn').first
|
85
|
+
JIRA::Issue.new_with_xml jira_call('updateIssue', issue_key, field_values)
|
76
86
|
end
|
77
87
|
|
78
88
|
##
|
@@ -97,14 +107,14 @@ module JIRA::RemoteAPI
|
|
97
107
|
def issue_with_key issue_key
|
98
108
|
JIRA::Issue.new_with_xml jira_call( 'getIssue', issue_key )
|
99
109
|
end
|
100
|
-
|
110
|
+
deprecate :issue_with_key
|
101
111
|
|
102
112
|
# @param [String] issue_id
|
103
113
|
# @return [JIRA::Issue]
|
104
114
|
def issue_with_id issue_id
|
105
115
|
JIRA::Issue.new_with_xml jira_call( 'getIssueById', issue_id )
|
106
116
|
end
|
107
|
-
|
117
|
+
deprecate :issue_with_id
|
108
118
|
|
109
119
|
# @param [String] id
|
110
120
|
# @param [Fixnum] max_results
|
@@ -113,20 +123,47 @@ module JIRA::RemoteAPI
|
|
113
123
|
def issues_from_filter_with_id id, max_results = 500, offset = 0
|
114
124
|
array_jira_call JIRA::Issue, 'getIssuesFromFilterWithLimit', id, offset, max_results
|
115
125
|
end
|
116
|
-
|
126
|
+
deprecate :issues_from_filter_with_id
|
117
127
|
|
118
128
|
# @param [String] issue_id
|
119
129
|
# @return [Time]
|
120
130
|
def resolution_date_for_issue_with_id issue_id
|
121
131
|
jira_call( 'getResolutionDateById', issue_id ).to_iso_date
|
122
132
|
end
|
123
|
-
|
133
|
+
deprecate :resolution_date_for_issue_with_id
|
124
134
|
|
125
135
|
# @param [String] issue_key
|
126
136
|
# @return [Time]
|
127
137
|
def resolution_date_for_issue_with_key issue_key
|
128
138
|
jira_call( 'getResolutionDateByKey', issue_key ).to_iso_date
|
129
139
|
end
|
130
|
-
|
140
|
+
deprecate :resolution_date_for_issue_with_key
|
141
|
+
|
142
|
+
##
|
143
|
+
# This method acts like {#update_issue} except that it also updates
|
144
|
+
# the status of the issue.
|
145
|
+
#
|
146
|
+
# The `action_id` parameter comes from the `id` of an available action.
|
147
|
+
# Normally you will use this method in conjunction with
|
148
|
+
# {#available_actions} to decide which action to take.
|
149
|
+
#
|
150
|
+
# @param [String] issue_key
|
151
|
+
# @param [String] action_id this is the id of workflow action
|
152
|
+
# @param [JIRA::FieldValue] *field_values
|
153
|
+
# @return [JIRA::Issue]
|
154
|
+
def progress_workflow_action issue_key, action_id, *field_values
|
155
|
+
JIRA::Issue.new_with_xml jira_call('progressWorkflowAction',
|
156
|
+
issue_key, action_id_string, field_values)
|
157
|
+
end
|
158
|
+
|
159
|
+
##
|
160
|
+
# Returns workflow actions available for an issue.
|
161
|
+
#
|
162
|
+
# @param [String] issue_key
|
163
|
+
# @return [Array<JIRA::NamedEntity>]
|
164
|
+
def available_actions issue_key
|
165
|
+
array_jira_call JIRA::NamedEntity, 'getAvailableActions', issue_key
|
166
|
+
end
|
167
|
+
deprecate :available_actions
|
131
168
|
|
132
169
|
end
|
@@ -6,14 +6,14 @@ module JIRA::RemoteAPI
|
|
6
6
|
def project_roles
|
7
7
|
array_jira_call JIRA::ProjectRole, 'getProjectRoles'
|
8
8
|
end
|
9
|
-
|
9
|
+
deprecate :project_roles
|
10
10
|
|
11
11
|
# @param [String] role_id
|
12
12
|
# @return [JIRA::ProjectRole]
|
13
13
|
def project_role_with_id role_id
|
14
14
|
JIRA::ProjectRole.new_with_xml jira_call( 'getProjectRole', role_id )
|
15
15
|
end
|
16
|
-
|
16
|
+
deprecate :project_role_with_id
|
17
17
|
|
18
18
|
# @param [JIRA::ProjectRole] project_role
|
19
19
|
# @return [JIRA::ProjectRole] the role that was created
|
@@ -12,14 +12,14 @@ module JIRA::RemoteAPI
|
|
12
12
|
def project_with_key project_key
|
13
13
|
JIRA::Project.new_with_xml jira_call( 'getProjectByKey', project_key )
|
14
14
|
end
|
15
|
-
|
15
|
+
deprecate :project_with_key
|
16
16
|
|
17
17
|
# @param [String] project_id
|
18
18
|
# @return [JIRA::Project]
|
19
19
|
def project_with_id project_id
|
20
20
|
JIRA::Project.new_with_xml jira_call( 'getProjectById', project_id )
|
21
21
|
end
|
22
|
-
|
22
|
+
deprecate :project_with_id
|
23
23
|
|
24
24
|
##
|
25
25
|
# @todo Parse the permission scheme
|
@@ -30,7 +30,7 @@ module JIRA::RemoteAPI
|
|
30
30
|
def project_including_schemes_with_id project_id
|
31
31
|
JIRA::Project.new_with_xml jira_call( 'getProjectWithSchemesById', project_id )
|
32
32
|
end
|
33
|
-
|
33
|
+
deprecate :project_including_schemes_with_id
|
34
34
|
|
35
35
|
##
|
36
36
|
# @note This will not fill in {JIRA::Scheme} data for the projects.
|
@@ -39,7 +39,9 @@ module JIRA::RemoteAPI
|
|
39
39
|
def projects
|
40
40
|
array_jira_call JIRA::Project, 'getProjectsNoSchemes'
|
41
41
|
end
|
42
|
-
alias_method :
|
42
|
+
alias_method :projects_without_schemes, :projects
|
43
|
+
deprecate :projects
|
44
|
+
deprecate :projects_without_schemes
|
43
45
|
|
44
46
|
##
|
45
47
|
# Requires you to set at least a project name, key, and lead.
|
data/lib/jiraSOAP/api/schemes.rb
CHANGED
@@ -6,12 +6,12 @@ module JIRA::RemoteAPI
|
|
6
6
|
def notification_schemes
|
7
7
|
array_jira_call JIRA::NotificationScheme, 'getNotificationSchemes'
|
8
8
|
end
|
9
|
-
|
9
|
+
deprecate :notification_schemes
|
10
10
|
|
11
11
|
# @return [Array<JIRA::PermissionScheme>]
|
12
12
|
def permission_schemes
|
13
13
|
array_jira_call JIRA::PermissionScheme, 'getPermissionSchemes'
|
14
14
|
end
|
15
|
-
|
15
|
+
deprecate :permission_schemes
|
16
16
|
|
17
17
|
end
|
@@ -9,12 +9,12 @@ module JIRA::RemoteAPI
|
|
9
9
|
def server_info
|
10
10
|
JIRA::ServerInfo.new_with_xml jira_call( 'getServerInfo' )
|
11
11
|
end
|
12
|
-
|
12
|
+
deprecate :server_info
|
13
13
|
|
14
14
|
# @return [JIRA::ServerConfiguration]
|
15
15
|
def server_configuration
|
16
16
|
JIRA::ServerConfiguration.new_with_xml jira_call( 'getConfiguration' )
|
17
17
|
end
|
18
|
-
|
18
|
+
deprecate :server_configuration
|
19
19
|
|
20
20
|
end
|
data/lib/jiraSOAP/api/users.rb
CHANGED
@@ -7,7 +7,7 @@ module JIRA::RemoteAPI
|
|
7
7
|
def user_with_name user_name
|
8
8
|
JIRA::User.new_with_xml jira_call( 'getUser', user_name )
|
9
9
|
end
|
10
|
-
|
10
|
+
deprecate :user_with_name
|
11
11
|
|
12
12
|
##
|
13
13
|
# It seems that creating a user without any permission groups will trigger
|
@@ -39,7 +39,7 @@ module JIRA::RemoteAPI
|
|
39
39
|
frag = jira_call 'getGroup', group_name
|
40
40
|
JIRA::UserGroup.new_with_xml frag
|
41
41
|
end
|
42
|
-
|
42
|
+
deprecate :group_with_name
|
43
43
|
|
44
44
|
# @param [JIRA::UserGroup] group
|
45
45
|
# @param [JIRA::User] user
|
@@ -7,7 +7,7 @@ module JIRA::RemoteAPI
|
|
7
7
|
def versions_for_project project_key
|
8
8
|
array_jira_call JIRA::Version, 'getVersions', project_key
|
9
9
|
end
|
10
|
-
|
10
|
+
deprecate :versions_for_project
|
11
11
|
|
12
12
|
##
|
13
13
|
# New versions cannot have the archived bit set and the release date
|
@@ -2,7 +2,10 @@
|
|
2
2
|
# Monkey patches to allow the SOAP building method to not need
|
3
3
|
# a special case for dealing with arrays.
|
4
4
|
class Array
|
5
|
-
|
6
|
-
|
5
|
+
|
6
|
+
# @param [Handsoap::XmlMason::Node] msg message the node to add the object to
|
7
|
+
def soapify_for msg
|
8
|
+
each { |item| item.soapify_for msg }
|
7
9
|
end
|
10
|
+
|
8
11
|
end
|
@@ -21,7 +21,7 @@ class JIRA::CustomFieldValue < JIRA::DynamicEntity
|
|
21
21
|
# @param [Handsoap::XmlMason::Node] msg SOAP message to add the object to
|
22
22
|
# @param [String] label tag name used in wrapping tags
|
23
23
|
# @return [Handsoap::XmlMason::Element]
|
24
|
-
def soapify_for
|
24
|
+
def soapify_for msg, label = 'customFieldValues'
|
25
25
|
msg.add label do |submsg|
|
26
26
|
submsg.add 'customfieldId', @id
|
27
27
|
submsg.add 'key', @key
|
@@ -30,7 +30,7 @@ class JIRA::FieldValue
|
|
30
30
|
# @param [Handsoap::XmlMason::Node] message the node to add the object to
|
31
31
|
# @param [String] label name for the tags that wrap the message
|
32
32
|
# @return [Handsoap::XmlMason::Element]
|
33
|
-
def soapify_for
|
33
|
+
def soapify_for message, label = 'fieldValue'
|
34
34
|
message.add label do |message|
|
35
35
|
message.add 'id', @field_name
|
36
36
|
message.add_simple_array 'values', @values unless @values.nil?
|
@@ -1,6 +1,6 @@
|
|
1
1
|
##
|
2
2
|
# Simple structure for a time and time zone; only used by JIRA::ServerInfo
|
3
|
-
# objects, which themselves are only created when {RemoteAPI#
|
3
|
+
# objects, which themselves are only created when {RemoteAPI#server_info}
|
4
4
|
# is called.
|
5
5
|
class JIRA::TimeInfo < JIRA::Entity
|
6
6
|
|
@@ -19,7 +19,7 @@ class JIRA::Version < JIRA::NamedEntity
|
|
19
19
|
|
20
20
|
# @param [Handsoap::XmlMason::Node] msg
|
21
21
|
# @return [Handsoap::XmlMason::Node]
|
22
|
-
def soapify_for
|
22
|
+
def soapify_for msg
|
23
23
|
msg.add 'name', @name
|
24
24
|
msg.add 'archived', @archived if @archived
|
25
25
|
msg.add 'sequence', @sequence if @sequence
|
@@ -43,18 +43,6 @@ class JIRA::JIRAService < Handsoap::Service
|
|
43
43
|
})
|
44
44
|
end
|
45
45
|
|
46
|
-
##
|
47
|
-
# An extra note for users when things break.
|
48
|
-
#
|
49
|
-
# @deprecated This will be removed in v1.0 when the API is stable.
|
50
|
-
# @return [nil]
|
51
|
-
def method_missing method, *args
|
52
|
-
message = "#{method} is not a valid method. Check the documentation; the "
|
53
|
-
message << 'API is not stabale yet and the method name likely changed.'
|
54
|
-
STDERR.puts message
|
55
|
-
super method, *args
|
56
|
-
end
|
57
|
-
|
58
46
|
|
59
47
|
protected
|
60
48
|
|
data/lib/jiraSOAP/url.rb
CHANGED
@@ -2,6 +2,7 @@ module JIRA
|
|
2
2
|
|
3
3
|
class << self
|
4
4
|
|
5
|
+
##
|
5
6
|
# When running on MacRuby, a URL will be wrapped into an NSURL object;
|
6
7
|
# but on all other Ruby implementations you will get a URI::HTTP object.
|
7
8
|
# The NSURL class is monkey patched just enough to make NSURL and
|
@@ -12,10 +13,13 @@ module JIRA
|
|
12
13
|
# JIRA.url_class.send JIRA.url_init_method, 'http://marketcircle.com'
|
13
14
|
#
|
14
15
|
# will be working code.
|
16
|
+
#
|
15
17
|
# @return [Class,Module]
|
16
18
|
attr_accessor :url_class
|
17
19
|
|
20
|
+
##
|
18
21
|
# We also need a variable for the init method for a URL object
|
22
|
+
#
|
19
23
|
# @return [Symbol]
|
20
24
|
attr_accessor :url_init_method
|
21
25
|
|
data/lib/jiraSOAP/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jiraSOAP
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,23 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
13
|
-
default_executable:
|
12
|
+
date: 2011-08-04 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: nokogiri
|
17
|
-
requirement: &
|
16
|
+
requirement: &70264277917080 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ~>
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.
|
21
|
+
version: 1.5.0
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
24
|
+
version_requirements: *70264277917080
|
26
25
|
- !ruby/object:Gem::Dependency
|
27
26
|
name: handsoap
|
28
|
-
requirement: &
|
27
|
+
requirement: &70264277916320 !ruby/object:Gem::Requirement
|
29
28
|
none: false
|
30
29
|
requirements:
|
31
30
|
- - ~>
|
@@ -33,40 +32,40 @@ dependencies:
|
|
33
32
|
version: 1.1.8
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
|
-
version_requirements: *
|
35
|
+
version_requirements: *70264277916320
|
37
36
|
- !ruby/object:Gem::Dependency
|
38
37
|
name: yard
|
39
|
-
requirement: &
|
38
|
+
requirement: &70264277915600 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
40
|
requirements:
|
42
41
|
- - ~>
|
43
42
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.7.
|
43
|
+
version: 0.7.2
|
45
44
|
type: :development
|
46
45
|
prerelease: false
|
47
|
-
version_requirements: *
|
46
|
+
version_requirements: *70264277915600
|
48
47
|
- !ruby/object:Gem::Dependency
|
49
48
|
name: redcarpet
|
50
|
-
requirement: &
|
49
|
+
requirement: &70264277915140 !ruby/object:Gem::Requirement
|
51
50
|
none: false
|
52
51
|
requirements:
|
53
52
|
- - ~>
|
54
53
|
- !ruby/object:Gem::Version
|
55
|
-
version: '1.
|
54
|
+
version: '1.17'
|
56
55
|
type: :development
|
57
56
|
prerelease: false
|
58
|
-
version_requirements: *
|
57
|
+
version_requirements: *70264277915140
|
59
58
|
- !ruby/object:Gem::Dependency
|
60
59
|
name: minitest
|
61
|
-
requirement: &
|
60
|
+
requirement: &70264277914680 !ruby/object:Gem::Requirement
|
62
61
|
none: false
|
63
62
|
requirements:
|
64
63
|
- - ! '>='
|
65
64
|
- !ruby/object:Gem::Version
|
66
|
-
version: 2.
|
65
|
+
version: 2.3.1
|
67
66
|
type: :development
|
68
67
|
prerelease: false
|
69
|
-
version_requirements: *
|
68
|
+
version_requirements: *70264277914680
|
70
69
|
description: Written to run fast and work on Ruby 1.9 as well as MacRuby
|
71
70
|
email:
|
72
71
|
- mrada@marketcircle.com
|
@@ -76,7 +75,6 @@ extra_rdoc_files:
|
|
76
75
|
- README.markdown
|
77
76
|
- ChangeLog
|
78
77
|
- LICENSE.txt
|
79
|
-
- .yardopts
|
80
78
|
- docs/GettingStarted.markdown
|
81
79
|
- docs/Examples.markdown
|
82
80
|
files:
|
@@ -138,16 +136,16 @@ files:
|
|
138
136
|
- lib/jiraSOAP/url.rb
|
139
137
|
- lib/jiraSOAP/version.rb
|
140
138
|
- lib/jiraSOAP.rb
|
139
|
+
- .yardopts
|
140
|
+
- Rakefile
|
141
141
|
- test/jiraSOAP_test.rb
|
142
|
+
- test/progressWorkflowActionTest.rb
|
142
143
|
- test/test_helper.rb
|
143
|
-
- Rakefile
|
144
144
|
- README.markdown
|
145
145
|
- ChangeLog
|
146
146
|
- LICENSE.txt
|
147
|
-
- .yardopts
|
148
147
|
- docs/GettingStarted.markdown
|
149
148
|
- docs/Examples.markdown
|
150
|
-
has_rdoc: true
|
151
149
|
homepage: http://github.com/Marketcircle/jiraSOAP
|
152
150
|
licenses:
|
153
151
|
- MIT
|
@@ -169,11 +167,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
167
|
version: '0'
|
170
168
|
requirements: []
|
171
169
|
rubyforge_project:
|
172
|
-
rubygems_version: 1.6
|
170
|
+
rubygems_version: 1.8.6
|
173
171
|
signing_key:
|
174
172
|
specification_version: 3
|
175
173
|
summary: A Ruby client for the JIRA SOAP API
|
176
174
|
test_files:
|
177
175
|
- test/jiraSOAP_test.rb
|
176
|
+
- test/progressWorkflowActionTest.rb
|
178
177
|
- test/test_helper.rb
|
179
|
-
- Rakefile
|