Class: JIRA::Issue
- Inherits:
-
DynamicEntity
- Object
- Entity
- DynamicEntity
- JIRA::Issue
- Defined in:
- lib/jiraSOAP/entities/issue.rb
Overview
add attributes for the comments and the attachment metadata
Issues with an UNRESOLVED status will have nil for the value for #resolution_id.
Contains most of the data and metadata for a JIRA issue, but does not contain the Comments 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 ⇒ Array<JIRA::Version>
Corresponds to
affectsVersions
in the javadoc. -
#assignee_username ⇒ String
Corresponds to
assignee
in the javadoc. -
#attachment_names ⇒ Array<String>
Corresponds to
attachmentNames
in the javadoc. -
#components ⇒ Array<JIRA::Version>
Corresponds to
components
in the javadoc. -
#create_time ⇒ Time
Corresponds to
created
in the javadoc. -
#custom_field_values ⇒ Array<JIRA::Version>
Corresponds to
customFieldValues
in the javadoc. -
#description ⇒ String
Corresponds to
description
in the javadoc. -
#due_date ⇒ Time
Corresponds to
duedate
in the javadoc. -
#environment ⇒ String
Corresponds to
environment
in the javadoc. -
#fix_versions ⇒ Array<JIRA::Version>
Corresponds to
fixVersions
in the javadoc. -
#key ⇒ String
Corresponds to
key
in the javadoc. -
#last_updated_time ⇒ Time
Corresponds to
updated
in the javadoc. -
#priority_id ⇒ String
Corresponds to
priority
in the javadoc. -
#project_name ⇒ String
Corresponds to
project
in the javadoc. -
#reporter_username ⇒ String
Corresponds to
reporter
in the javadoc. -
#resolution_id ⇒ String
Corresponds to
resolution
in the javadoc. -
#status_id ⇒ String
Corresponds to
status
in the javadoc. -
#summary ⇒ String
Corresponds to
summary
in the javadoc. -
#type_id ⇒ String
Corresponds to
type
in the javadoc. -
#votes ⇒ Fixnum
Corresponds to
votes
in the javadoc.
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, #to_soap
Instance Attribute Details
#affects_versions ⇒ Array<JIRA::Version>
Corresponds to affectsVersions
in the javadoc.
#assignee_username ⇒ String
Corresponds to assignee
in the javadoc.
#attachment_names ⇒ Array<String>
Corresponds to attachmentNames
in the javadoc.
#components ⇒ Array<JIRA::Version>
Corresponds to components
in the javadoc.
#create_time ⇒ Time
Corresponds to created
in the javadoc.
#custom_field_values ⇒ Array<JIRA::Version>
Corresponds to customFieldValues
in the javadoc.
#description ⇒ String
Corresponds to description
in the javadoc.
#due_date ⇒ Time
Corresponds to duedate
in the javadoc.
This is actually a Time object with no time resolution.
#environment ⇒ String
Corresponds to environment
in the javadoc.
#fix_versions ⇒ Array<JIRA::Version>
Corresponds to fixVersions
in the javadoc.
#key ⇒ String
Corresponds to key
in the javadoc.
#last_updated_time ⇒ Time
Corresponds to updated
in the javadoc.
#priority_id ⇒ String
Corresponds to priority
in the javadoc.
#project_name ⇒ String
Corresponds to project
in the javadoc.
#reporter_username ⇒ String
Corresponds to reporter
in the javadoc.
#resolution_id ⇒ String
Corresponds to resolution
in the javadoc.
#status_id ⇒ String
Corresponds to status
in the javadoc.
#summary ⇒ String
Corresponds to summary
in the javadoc.
#type_id ⇒ String
Corresponds to type
in the javadoc.
#votes ⇒ Fixnum
Corresponds to votes
in the javadoc.
Instance Method Details
#soapify_for(msg) ⇒ Object
see if we can use the simple and complex array builders
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.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/jiraSOAP/entities/issue.rb', line 58 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 |