Xml import - Activity signatures

Every change to an artifact is recorded as an activity. There is currently no activity-type element, so other details of the activity must be interpreted to determine the intent of the activity. This document will describe how an xml activity element will be interpreted during an import.

The creation activity-set

The creation activity-set element is identified by:

<type>Create Issue</type>
It will contain an activity element of the following form in addition to any activities related to setting initial values of attributes:
<activity>
  <id>268</id>
  <attribute>Null attribute</attribute>
  <old-value/>
  <new-value/>
</activity>

Sample activity initializing the Platform attribute:

<activity>
  <id>265</id>
  <attribute>Platform</attribute>
  <new-value>DEC</new-value>
</activity>

Activity-sets which edit artifacts

An edit activity-set element is identified by:

<type>Edit Issue</type>

Within within context of create-different-db import type one often finds activity-set elements relating to past state of an artifact. The first example shown below will include 3 activity-sets describing past state of an URL. While update-same-db type can also contain activity-sets related to old state, it is often ignored; and only the latest descriptions of changes are processed. Later examples will concentrate on activities describing the latest state of the artifact.

Activity attachments

There are three types of activity that include an <attachment> element. They include comments, url's, and file attachments. An important thing to note is that <attachment> element which is the child of the <activity> will contain the latest data. So that an artfact that had an url added, then modified 2 times, and finally deleted, will contain the same attachment xml for all 4 activities. Here is an example:

<activity-set>
  <id>169</id>
  <type>Edit Issue</type>
  <created-by>gollum</created-by>
  <created-date>
    <format>yyyy-MM-dd HH:mm:ss z</format>
    <timestamp>2004-04-20 18:42:23 GMT</timestamp>
  </created-date>
  <activities>
	<activity>
      <id>271</id>
      <attribute>Null attribute</attribute>
      <old-value/>
      <new-value>http://example.com</new-value>
      <end-date>
        <format>yyyy-MM-dd HH:mm:ss z</format>
        <timestamp>2004-04-20 18:45:20 GMT</timestamp>
      </end-date>
      <attachment>
        <id>162</id>
        <name>Smeagol's site is better</name>
        <type>URL</type>
        <data>http://example.com</data>
        <mimetype>text/plain</mimetype>
	    <created-date>
          <format>yyyy-MM-dd HH:mm:ss z</format>
          <timestamp>2004-04-20 18:42:23 GMT</timestamp>
        </created-date>
      	<modified-date>
          <format>yyyy-MM-dd HH:mm:ss z</format>
          <timestamp>2004-04-20 22:45:56 GMT</timestamp>
        </modified-date>
        <created-by>gollum</created-by>
        <deleted>true</deleted>
      </attachment>
    </activity>
  </activities>
</activity-set>

Here the Gollum has entered a URL to what might be a search engine, http://gollum.org and gives it the description "my site is so bland". The url can be derived from the the new-value element, but to find the original description, we must look forward to when it was changed.

The attachment shows the final state and is the same for each of the following activity-sets.

<activity-set>
  <id>170</id>
  <type>Edit Issue</type>
  <created-by>gollum</created-by>
  <created-date>
    <format>yyyy-MM-dd HH:mm:ss z</format>
    <timestamp>2004-04-20 18:45:20 GMT</timestamp>
  </created-date>
  <activities>
	<activity>
      <id>272</id>
      <attribute>Null attribute</attribute>
      <old-value>http://example.com</old-value>
      <new-value>http://example.com</new-value>
      <end-date>
        <format>yyyy-MM-dd HH:mm:ss z</format>
        <timestamp>2004-04-20 18:49:26 GMT</timestamp>
      </end-date>
      <attachment>
        <id>162</id>
        <name>Smeagol's site is better</name>
        <type>URL</type>
        <data>http://smeagol.example.com</data>
        <mimetype>text/plain</mimetype>
        <created-date>
          <format>yyyy-MM-dd HH:mm:ss z</format>
          <timestamp>2004-04-20 18:42:23 GMT</timestamp>
        </created-date>
        <modified-date>
          <format>yyyy-MM-dd HH:mm:ss z</format>
          <timestamp>2004-04-20 22:45:56 GMT</timestamp>
        </modified-date>
        <created-by>gollum</created-by>
        <deleted>true</deleted>
      </attachment>
    </activity>
  </activities>
</activity-set>

Here Gollum changes the link to point to a better site.

<activity-set>
  <id>171</id>
  <type>Edit Issue</type>
  <created-by>gollum</created-by>
  <created-date>
    <format>yyyy-MM-dd HH:mm:ss z</format>
    <timestamp>2004-04-20 18:47:09 GMT</timestamp>
  </created-date>
  <activities>
	<activity>
      <id>273</id>
      <attribute>Null attribute</attribute>
      <old-value>my site is so bland</old-value>
      <new-value>Smeagol's site is better</new-value>
      <attachment>
        <id>162</id>
        <name>Smeagol's site is better</name>
        <type>URL</type>
        <data>http://smeagol.example.com</data>
        <mimetype>text/plain</mimetype>
	    <created-date>
          <format>yyyy-MM-dd HH:mm:ss z</format>
          <timestamp>2004-04-20 18:42:23 GMT</timestamp>
        </created-date>
        <modified-date>
          <format>yyyy-MM-dd HH:mm:ss z</format>
          <timestamp>2004-04-20 22:45:56 GMT</timestamp>
        </modified-date>
        <created-by>gollum</created-by>
        <deleted>true</deleted>
      </attachment>
    </activity>
  </activities>
</activity-set>

Here Gollum changes the description of the url. And this gives us a clue as to the original description for the url.

<activity-set>
  <id>183</id>
  <type>Edit Issue</type>
  <created-by>gollum</created-by>
  <created-date>
    <format>yyyy-MM-dd HH:mm:ss z</format>
    <timestamp>2004-04-20 22:45:56 GMT</timestamp>
  </created-date>
  <activities>
  <activity>
      <id>285</id>
      <attribute>Null attribute</attribute>
      <old-value>http://smeagol.org</old-value>
       <new-value/>
      <attachment>
        <id>162</id>
        <name>Smeagol's site is better</name>
        <type>URL</type>
        <data>http://smeagol.example.com</data>
        <mimetype>text/plain</mimetype>
        <created-date>
          <format>yyyy-MM-dd HH:mm:ss z</format>
          <timestamp>2004-04-20 18:42:23 GMT</timestamp>
        </created-date>
        <modified-date>
          <format>yyyy-MM-dd HH:mm:ss z</format>
          <timestamp>2004-04-20 22:45:56 GMT</timestamp>
        </modified-date>
        <created-by>gollum</created-by>
        <deleted>true</deleted>
      </attachment>
    </activity>
  </activities>
</activity-set>

Finally, jealous Gollum deletes the url. This was predicted by the <deleted>true</deleted> element found in each of the previous attachment elements.

The following examples are going to show activity-sets only relating to the latest state of the artifact.

Comments

Comments are described as attachment elements with name and type set as shown.

Adding a new comment

Note that the comment text is repeated as the activity new-value and the attachment data.

   <activity>
     <id>269</id>
     <attribute>Null attribute</attribute>
     <old-value/>
     <new-value>This comment is just added.</new-value>
     <attachment>
       <id>161</id>
       <name>comment</name>
       <type>COMMENT</type>
       <data>This comment is just added.</data>
       <mimetype>text/plain</mimetype>
       <created-date>
         <format>yyyy-MM-dd HH:mm:ss z</format>
         <timestamp>2004-04-20 18:09:23 GMT</timestamp>
       </created-date>
       <modified-date>
       <format>yyyy-MM-dd HH:mm:ss z</format>
       <timestamp>2004-04-20 18:09:23 GMT</timestamp>
       </modified-date>
       <created-by>gollum</created-by>
       <deleted>false</deleted>
     </attachment>
   </activity>

Edit an existing comment

Comments may not be edited via the update-same-db type. But an artifact that is being imported as create-different-db may have some edited comments.

<activity>
  <id>270</id>
  <attribute>Null attribute</attribute>
  <old-value>This comment is just added.</old-value>
  <new-value>This comment has now been changed.</new-value>
  <attachment>
    <id>161</id>
    <name>comment</name>
    <type>COMMENT</type>
    <data>This comment has now been changed.</data>
    <mimetype>text/plain</mimetype>
    <created-date>
        <format>yyyy-MM-dd HH:mm:ss z</format>
        <timestamp>2004-04-20 18:09:23 GMT</timestamp>
    </created-date>
    <modified-date>
        <format>yyyy-MM-dd HH:mm:ss z</format>
        <timestamp>2004-04-20 18:17:17 GMT</timestamp>
    </modified-date>
    <created-by>gollum</created-by>
    <deleted>false</deleted>
  </attachment>
</activity>

The initial activity record is modified to add an end-date:

<end-date>
  <format>yyyy-MM-dd HH:mm:ss z</format>
  <timestamp>2004-04-20 18:17:17 GMT</timestamp>
</end-date>

URL

URL's were described in detail above, but are shown here in a style more appropriate for the update-same-db type.

Add new url

<activity>
  <id>271</id>
  <attribute>Null attribute</attribute>
  <old-value/>
  <new-value>http://gollum.example.com</new-value>
  <attachment>
    <id>162</id>
    <name>my site is so bland</name>
    <type>URL</type>
    <data>http://gollum.example.com</data>
    <mimetype>text/plain</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 18:42:23 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 18:42:23 GMT</timestamp>
    </modified-date>
    <created-by>gollum</created-by>
    <deleted>false</deleted>
  </attachment>
</activity>

Modify url

<activity>
  <id>272</id>
  <attribute>Null attribute</attribute>
  <old-value>http://gollum.example.com</old-value>
  <new-value>http://smeagol.example.com</new-value>
  <attachment>
    <id>162</id>
    <name>my site is so bland</name>
    <type>URL</type>
    <data>http://smeagol.example.com</data>
    <mimetype>text/plain</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 18:42:23 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 18:45:20 GMT</timestamp>
    </modified-date>
    <created-by>gollum</created-by>
    <deleted>false</deleted>
  </attachment>
</activity>

Modify url description

<activity>
  <id>273</id>
  <attribute>Null attribute</attribute>
  <old-value>my site is so bland</old-value>
  <new-value>Smeagol's site is better</new-value>
  <attachment>
    <id>162</id>
    <name>Smeagol's site is better</name>
    <type>URL</type>
    <data>http://smeagol.example.com</data>
    <mimetype>text/plain</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 18:42:23 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 18:47:09 GMT</timestamp>
    </modified-date>
    <created-by>gollum</created-by>
    <deleted>false</deleted>
  </attachment>
</activity>

Removing URL

<activity>
  <id>275</id>
  <attribute>Null attribute</attribute>
  <old-value>http://smeagol.example.com</old-value>
  <new-value/>
  <attachment>
    <id>163</id>
    <name>Smeagol's site is better</name>
    <type>URL</type>
    <data>http://smeagol.example.com</data>
    <mimetype>text/plain</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 18:48:46 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 18:49:26 GMT</timestamp>
    </modified-date>
    <created-by>gollum</created-by>
    <deleted>true</deleted>
  </attachment>
</activity>

File attachments

File attachments have ATTACHMENT type.

Add file

File attachments are currently only allowed during import by those with shell access to the server. The xml shown is an example of how it would look for an exported artifact. If it were to be used to import a file attachment, a <reconcile-path>true</reconcile-path> element would be added to the attachment and the filename element would be an absolute path to the file's location on the server.

<activity>
  <id>278</id>
  <attribute>Null attribute</attribute>
  <old-value/>
  <new-value>last_result.html</new-value>
  <attachment>
    <id>165</id>
    <name>
another issue list that didn't match the expected template.
    </name>
    <type>ATTACHMENT</type>
    <filename>last_result.html</filename>
    <mimetype>text/html</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 19:05:10 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 19:05:10 GMT</timestamp>
    </modified-date>
    <created-by>gollum</created-by>
    <deleted>false</deleted>
  </attachment>
</activity>

Remove file

<activity>
  <id>279</id>
  <attribute>Null attribute</attribute>
  <old-value>last_result.html</old-value>
  <new-value/>
  <attachment>
    <id>165</id>
    <name>
another issue list that didn't match the expected template.
    </name>
    <type>ATTACHMENT</type>
    <filename>last_result.html</filename>
    <mimetype>text/html</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 19:05:10 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-04-20 20:01:22 GMT</timestamp>
    </modified-date>
    <created-by>gollum</created-by>
    <deleted>true</deleted>
  </attachment>
</activity>

Attributes

Attribute activities look similar for create-different-db and update-same-db, but create-different-db will often contain many activities with an end-date element such as:

<end-date>
  <format>yyyy-MM-dd HH:mm:ss z</format>
  <timestamp>2004-04-20 20:01:22 GMT</timestamp>
</end-date>

These represent historical values that have been superceded by later changes. Historical data is irrelevant for update-same-db type so records including an end-date will be ignored.

Adding one option attribute value

<activity-set>
  <id>124</id>
  <type>Edit Issue</type>
  <created-by>root</created-by>
  <created-date>
    <format>yyyy-MM-dd HH:mm:ss z</format>
    <timestamp>2004-05-03 22:36:45 GMT</timestamp>
  </created-date>
  <activities>
    <activity>
      <id>192</id>
      <attribute>Severity</attribute>
      <old-value/>
      <new-value>Critical</new-value>
    </activity>
  </activities>
  <attachment>
    <id>119</id>
    <name>comment</name>
    <type>MODIFICATION</type>
    <data>Added a value</data>
    <mimetype>text/plain</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-05-03 22:36:45 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-05-03 22:36:45 GMT</timestamp>
    </modified-date>
    <created-by>root</created-by>
    <deleted>false</deleted>
  </attachment>
</activity-set>

Changing a user from Assignee to CC

An activity is associated with a single atttribute, so this change is modeled as a removal of 'root' from the 'Assigned to' attribute and the addition of 'root' to the 'CC' attribute.

<activity-set>
  <id>125</id>
  <type>Edit Issue</type>
  <created-by>root</created-by>
  <created-date>
    <format>yyyy-MM-dd HH:mm:ss z</format>
    <timestamp>2004-05-03 22:42:04 GMT</timestamp>
  </created-date>
  <activities>
    <activity>
      <id>193</id>
      <attribute>CC</attribute>
      <old-value/>
      <new-value>root</new-value>
    </activity>
    <activity>
      <id>194</id>
      <attribute>Assigned to</attribute>
      <old-value>root</old-value>
      <new-value/>
      <end-date>
        <format>yyyy-MM-dd HH:mm:ss z</format>
        <timestamp>2004-05-03 22:42:04 GMT</timestamp>
      </end-date>
    </activity>
  </activities>
  <attachment>
    <id>121</id>
    <name>comment</name>
    <type>MODIFICATION</type>
    <data>Switch from assignee to cc try #2</data>
    <mimetype>text/plain</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-05-03 22:42:04 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-05-03 22:42:04 GMT</timestamp>
    </modified-date>
    <created-by>root</created-by>
    <deleted>false</deleted>
  </attachment>
</activity-set>

Changing the value of a multi-valued attribute

This example changes the CC attribute from root to u1. Multi-valued attributes are not modeled as changing from one value to another; so the activities are a removal of root from CC and another activity which adds u1 to CC.

<activity-set>
  <id>126</id>
  <type>Edit Issue</type>
  <created-by>root</created-by>
  <created-date>
    <format>yyyy-MM-dd HH:mm:ss z</format>
    <timestamp>2004-05-03 22:52:20 GMT</timestamp>
  </created-date>
  <activities>
    <activity>
      <id>195</id>
      <attribute>CC</attribute>
      <old-value/>
      <new-value>u1</new-value>
    </activity>
    <activity>
      <id>196</id>
      <attribute>CC</attribute>
      <old-value>root</old-value>
      <new-value/>
      <end-date>
        <format>yyyy-MM-dd HH:mm:ss z</format>
        <timestamp>2004-05-03 22:52:20 GMT</timestamp>
      </end-date>
    </activity>
  </activities>
  <attachment>
    <id>122</id>
    <name>comment</name>
    <type>MODIFICATION</type>
    <data>cc changed from root to u1</data>
    <mimetype>text/plain</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-05-03 22:52:20 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-05-03 22:52:20 GMT</timestamp>
    </modified-date>
    <created-by>root</created-by>
    <deleted>false</deleted>
  </attachment>
</activity-set>

Changing the value of a single valued attribute

<activity-set>
  <id>127</id>
  <type>Edit Issue</type>
  <created-by>root</created-by>
  <created-date>
    <format>yyyy-MM-dd HH:mm:ss z</format>
    <timestamp>2004-05-03 23:18:27 GMT</timestamp>
  </created-date>
  <activities>
    <activity>
      <id>197</id>
      <attribute>Component</attribute>
      <old-value>Component 1</old-value>
      <new-value>Component 2</new-value>
    </activity>
  </activities>
  <attachment>
    <id>123</id>
    <name>comment</name>
    <type>MODIFICATION</type>
    <data>changing component</data>
    <mimetype>text/plain</mimetype>
    <created-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-05-03 23:18:27 GMT</timestamp>
    </created-date>
    <modified-date>
      <format>yyyy-MM-dd HH:mm:ss z</format>
      <timestamp>2004-05-03 23:18:27 GMT</timestamp>
    </modified-date>
    <created-by>root</created-by>
    <deleted>false</deleted>
  </attachment>
</activity-set>