Class: JIRA::Issue
- Inherits:
-
DynamicEntity
- Object
- Entity
- DynamicEntity
- JIRA::Issue
- Defined in:
- lib/jiraSOAP/entities/issue.rb
Overview
Issues with an UNRESOLVED status will have nil for the value of #resolution.
Contains most of the data and metadata for a JIRA issue, but does not contain the Comment‘s or AttachmentMetadata.
This class is easily the most convoluted structure in the API, and will likely be the greatest source of bugs. The irony of the situation is that this structure is also the most critical to have in working order.
Instance Attribute Summary collapse
- #affects_versions ⇒ [JIRA::Version]
- #assignee_username ⇒ String
- #attachment_names ⇒ [String]
- #components ⇒ [JIRA::Component]
- #create_time ⇒ Time
- #custom_field_values ⇒ [JIRA::CustomFieldValue]
- #description ⇒ String
-
#due_date ⇒ Time
This is actually a Time object with no time resolution.
- #environment ⇒ String
- #fix_versions ⇒ [JIRA::Version]
- #key ⇒ String
- #last_updated_time ⇒ Time
- #priority_id ⇒ String
- #project_name ⇒ String
- #reporter_username ⇒ String
- #resolution_id ⇒ String
- #status_id ⇒ String
- #summary ⇒ String
- #type_id ⇒ String
- #votes ⇒ Fixnum
Attributes inherited from DynamicEntity
Instance Method Summary collapse
-
#soapify_for(msg) ⇒ Object
Generate the SOAP message fragment for an issue.
Methods inherited from Entity
add_attributes, #initialize_with_xml, new_with_xml
Instance Attribute Details
#affects_versions ⇒ [JIRA::Version]
68 69 70 |
# File 'lib/jiraSOAP/entities/issue.rb', line 68 def affects_versions @affects_versions end |
#assignee_username ⇒ String
56 57 58 |
# File 'lib/jiraSOAP/entities/issue.rb', line 56 def assignee_username @assignee_username end |
#attachment_names ⇒ [String]
89 90 91 |
# File 'lib/jiraSOAP/entities/issue.rb', line 89 def @attachment_names end |
#components ⇒ [JIRA::Component]
86 87 88 |
# File 'lib/jiraSOAP/entities/issue.rb', line 86 def components @components end |
#create_time ⇒ Time
71 72 73 |
# File 'lib/jiraSOAP/entities/issue.rb', line 71 def create_time @create_time end |
#custom_field_values ⇒ [JIRA::CustomFieldValue]
92 93 94 |
# File 'lib/jiraSOAP/entities/issue.rb', line 92 def custom_field_values @custom_field_values end |
#description ⇒ String
41 42 43 |
# File 'lib/jiraSOAP/entities/issue.rb', line 41 def description @description end |
#due_date ⇒ Time
Returns this is actually a Time object with no time resolution.
74 75 76 |
# File 'lib/jiraSOAP/entities/issue.rb', line 74 def due_date @due_date end |
#environment ⇒ String
83 84 85 |
# File 'lib/jiraSOAP/entities/issue.rb', line 83 def environment @environment end |
#fix_versions ⇒ [JIRA::Version]
77 78 79 |
# File 'lib/jiraSOAP/entities/issue.rb', line 77 def fix_versions @fix_versions end |
#key ⇒ String
35 36 37 |
# File 'lib/jiraSOAP/entities/issue.rb', line 35 def key @key end |
#last_updated_time ⇒ Time
47 48 49 |
# File 'lib/jiraSOAP/entities/issue.rb', line 47 def last_updated_time @last_updated_time end |
#priority_id ⇒ String
62 63 64 |
# File 'lib/jiraSOAP/entities/issue.rb', line 62 def priority_id @priority_id end |
#project_name ⇒ String
65 66 67 |
# File 'lib/jiraSOAP/entities/issue.rb', line 65 def project_name @project_name end |
#reporter_username ⇒ String
59 60 61 |
# File 'lib/jiraSOAP/entities/issue.rb', line 59 def reporter_username @reporter_username end |
#resolution_id ⇒ String
80 81 82 |
# File 'lib/jiraSOAP/entities/issue.rb', line 80 def resolution_id @resolution_id end |
#status_id ⇒ String
53 54 55 |
# File 'lib/jiraSOAP/entities/issue.rb', line 53 def status_id @status_id end |
#summary ⇒ String
38 39 40 |
# File 'lib/jiraSOAP/entities/issue.rb', line 38 def summary @summary end |
#type_id ⇒ String
44 45 46 |
# File 'lib/jiraSOAP/entities/issue.rb', line 44 def type_id @type_id end |
#votes ⇒ Fixnum
50 51 52 |
# File 'lib/jiraSOAP/entities/issue.rb', line 50 def votes @votes end |
Instance Method Details
#soapify_for(msg) ⇒ Object
see if we can use the simple and complex array builders
make this method shorter
Generate the SOAP message fragment for an issue. Can you spot the oddities and inconsistencies? (hint: there are many).
We don’t bother including fields that are ignored. I tried to only ignore fields that will never be needed at creation time, but I may have messed up.
We don’t wrap the whole thing in ‘issue’ tags for JIRA::Issue#RemoteAPI#RemoteAPI#create_issue_with_issue calls; this is an inconsistency in the way jiraSOAP works and may need to be worked around for other RemoteAPI methods.
Servers only seem to accept issues if components/versions are just ids and do not contain the rest of the Component/Version structure.
To get the automatic assignee we pass ‘-1’ as the value for @assignee.
Passing an environment/due date field with a value of nil causes the server to complain about the formatting of the message.
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/jiraSOAP/entities/issue.rb', line 117 def soapify_for(msg) #might be going away, since it appears to have no effect at creation time msg.add 'reporter', @reporter_name unless @reporter.nil? msg.add 'priority', @priority_id msg.add 'type', @type_id msg.add 'project', @project_name msg.add 'summary', @summary msg.add 'description', @description msg.add 'components' do |submsg| (@components || []).each { |component| submsg.add 'components' do |component_msg| component_msg.add 'id', component.id end } end msg.add 'affectsVersions' do |submsg| (@affects_versions || []).each { |version| submsg.add 'affectsVersions' do |version_msg| version_msg.add 'id', version.id end } end msg.add 'fixVersions' do |submsg| (@fix_versions || []).each { |version| submsg.add 'fixVersions' do |version_msg| version_msg.add 'id', version.id end } end msg.add 'assignee', (@assignee_name || '-1') msg.add_complex_array 'customFieldValues', (@custom_field_values || []) msg.add 'environment', @environment unless @environment.nil? msg.add 'duedate', @due_date.xmlschema unless @due_date.nil? end |