Skip to content

Commit

Permalink
added create_issue_with_security_level
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmartin committed Dec 3, 2012
1 parent f73ff88 commit 6bee7f2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/jiraSOAP/api/issues.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ def update_issue issue_key, *field_values
def create_issue_with_issue issue
JIRA::Issue.new_with_xml jira_call( 'createIssue', issue )
end

# @param [JIRA::Issue] issue
# @param [Fixnum] security_level
# @return [JIRA::Issue]
def create_issue_with_security_level issue, security_level
JIRA::Issue.new_with_xml jira_call( 'createIssueWithSecurityLevel', issue, security_level )
end

# @param [String] issue_key
# @return [JIRA::Issue]
Expand Down
5 changes: 5 additions & 0 deletions lib/jiraSOAP/api/server_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ def server_configuration
JIRA::ServerConfiguration.new_with_xml jira_call( 'getConfiguration' )
end


def security_levels(project_key)
array_jira_call JIRA::SecurityLevel, 'getSecurityLevels', project_key
end

end
1 change: 1 addition & 0 deletions lib/jiraSOAP/entities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
require 'jiraSOAP/entities/time_info'
require 'jiraSOAP/entities/server_info'
require 'jiraSOAP/entities/server_configuration'
require 'jiraSOAP/entities/security_level'

require 'jiraSOAP/entities/worklog'
9 changes: 9 additions & 0 deletions lib/jiraSOAP/entities/security_level.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class JIRA::SecurityLevel < JIRA::Entity

# @return [Integer]
add_attribute :id, 'id', :to_i

# @return [String]
add_attribute :name, 'name', :content

end
3 changes: 3 additions & 0 deletions lib/jiraSOAP/nokogiri_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def to_url
# @return [Array(String,String,String),nil]
def to_color_triple
return if (temp = content).empty?
temp = '#FF0000' if temp == '#red'
temp = '#00FF00' if temp == '#green'
temp = '#0000FF' if temp == '#blue'
temp.match(/#(..)(..)(..)/).captures
end
alias_method :to_colour_triple, :to_color_triple
Expand Down

0 comments on commit 6bee7f2

Please sign in to comment.