IssueUpdateMessage |
The IssueUpdate element is used to update an exiting issue. At a minimum the IssueId field must be specified.
The IssueId field can be used to specify an IssueNumber, but only if RMTrack's per project issue numbering site option has been enabled.
Any number of attachments, related issues, related items or subscribers can be added or removed. Note that adding more than a few attachments could cause significant delays.
On successful update the server will respond with an IssueDetails message that contains the updated issue's id number. If any errors are encountered then an Error message is returned.
Concurrency control is optional. If the LastUpdated timestamp field is specified (encoded as a base64 string) it will be compared with the current value. If the values do not match then the update will be rejected; if the values match the update will proceed.
The following message will update the issue and add an attached file, add a related issue, add a related item, and add a subscriber.
<?xml version=\"1.0\" encoding=\"utf-8\" ?> <IssueUpdate> <Fields> <IssueId>24</ProjectId> <ResolutionCode>To be fixed</ResolutionCode> <StatusCode>Open</StatusCode> <AssignedToUserId>jsmith</AssignedToUserId> </Fields> <Attachments> <Attachment> <AttachmentMimeType>text/plain</AttachmentMimeType> <AttachmentFilename>a.txt</AttachmentFilename> <AttachmentData>dGhlIHF1aWNrIGJyb3duIGZveA==</AttachmentData> </Attachment> </Attachments> <RelatedIssues> <RelatedIssueId>43</RelatedIssueId> </RelatedIssues> <RelatedItems> <RelatedItem> <RelatedItemUrl>http://www.rmtrack.com</RelatedItemUrl> <RelatedItemTitle>RMTrack.com</RelatedItemTitle> <RelatedItemOpenInNewWindow>false</RelatedItemOpenInNewWindow> </RelatedItem> </RelatedItems> <Subscribers> <Subscriber> <SubscriberUserId>jdoe</SubscriberUserId> <SubscriberSendEMail>true</SubscriberSendEMail> </Subscriber> </Subscribers> </IssueUpdate>
The Fields element accepts any child element, and each child element is named after an actual field on the issue record. For example to specify the value for the Summary issue field then specify any child element: <Summary>Value goes here</Summary>.
The names of the Fields child elements must match actual issue fields. The matching is not case sensitive, except that the closing tag must exactly match the opening tag. For example <SUMMARY>Some problems</SUMMARY> will match the issue field "Summary". However <SUMMARY>Some problems</summary> will fail basic XML validation.
The contents of any particular field will be validated based upon the field definition. If a field is defined as having a maximum length of 50 characters then this validation will occur.
Date and Date Time fields must be formatted according to the standard XML date format. For a simple plain old date, without a time, format it using yyyy-mm-dd.
Dates that include times are more complicated. RMTrack stores times either in the time zone of the server or in UTC. Incoming times that do not specify a time zone offset are assumed to be in the time zone that RMTrack is configured to use (either the server's time zone or UTC). Times that specify a time zone offset are converted appropriately (either to the server's time zone or to UTC).
The AttachmentData contents must be encoded as a base64 string.
The following is the schema definition used for the <IssueUpdate> message (see IssueDetailsPost)
<xs:element name="IssueUpdate"> <xs:complexType> <xs:all> <xs:element name="Fields" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:any processContents="skip" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Attachments" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="Attachment"> <xs:complexType> <xs:all> <xs:element name="AttachmentFilename" type="xs:string" minOccurs="1" maxOccurs="1" /> <xs:element name="AttachmentMimeType" type="xs:string" minOccurs="1" maxOccurs="1" /> <xs:element name="AttachmentData" type="xs:string" minOccurs="1" maxOccurs="1" /> </xs:all> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="AttachmentsToDelete" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="AttachmentId" type="xs:integer" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="RelatedIssues" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="RelatedIssueId" type="xs:integer" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="RelatedIssuesToDelete" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="RelatedIssueId" type="xs:integer" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="RelatedItems" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="RelatedItem"> <xs:complexType> <xs:all> <xs:element name="RelatedItemUrl" type="xs:string" /> <xs:element name="RelatedItemTitle" type="xs:string" /> <xs:element name="RelatedItemOpenInNewWindow" type="xs:boolean" /> </xs:all> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="RelatedItemsToDelete" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="RelatedItemId" type="xs:integer" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Subscribers" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="Subscriber"> <xs:complexType> <xs:all> <xs:element name="SubscriberUserId" type="xs:string" /> <xs:element name="SubscriberSendEMail" type="xs:boolean" /> </xs:all> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="SubscribersToDelete" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:element name="SubscriberUserId" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element>