TeamForge EventQ Work Item Configuration API

Submission parameters

Submission queue
  • queue_name: eventq.work_items
  • auto_delete: false
  • durable: true
Top-level
Parameter Required/Optional Description
api_version Required A string that matches the API version this document is for.
source_association_key Required A key generated by TeamForge EventQ that links incoming work items with the appropriate source server.
Example: "source_association_key": "6t5qM5AuLLWLkmqFJeKp"
workitem_settings Required Tracker configuration details.
Objects
workitem_settings - The following fields should be in this workitem_settings object.
Field Required/Optional Description
event_time Required A string containing a timestamp in UTC timezone and RFC 3339 format.
url Required A string with the browse URL for the system. EventQ will append an individual work item's id to that url to link back to the work item
tracker Required Tracker configuration information. A JSON object describing the structure of the tracker.

Accepted values

  • name (Required) - A name for the tracker.
  • id (Required) - A string containing a unique (on the reporting system) identifier for the tracker.
  • key (Optional) - A string containing the tracker key (usually used to prefix the work-item ids).
  • regex (Required) - A string containing a regular expression that EventQ will use to associate work-items with commits using the commit message.
  • icon (Optional) - A string containing a URL for this tracker's icon.
  • statuses (Required) - An array of status objects associated with the tracker.
    • id (Required) - A string containing a unique(on the underlying system) identifier for the status.
    • name (Required) - A string containing the name of the status.

Examples

The following code examples are Copyright 2015 CollabNet, Inc., licensed under the Apache License, Version 2.0 (the "License"); you may not use this code except in compliance with the License. You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0]

Sample Submission JSON
{
      "api_version": "1",
      "source_association_key" : "150e8951-19e1-4066-8b74-601026dd6cde",
      "workitem_settings" : {
      "url": "http://www.example.com/jira",
      "event_time": "2012-10-02T17:15:32.320Z",
      "tracker": {
                   "name": "EventQ/Stories",
                   "id": "01234567abcdef01234567",
                   "key":"ORC",
                   "regex": "ORC-\d+",
                   "icon": "http://www.example.com/jira/browse/bug.jpig",
                   "statuses": [
                       {"name": "Open", "id": "abcdef"},
                       {"name": "In progress", "id": "123abc"},
                       {"name": "Closed", "id": "456123"}
                   ]
                 }
      }
}
Ruby Submission Example
You will need to change the following example before you can run it. Set the Rabbit MQ hostname and the association key, and paste a JSON block following the build format specified on this page.
require 'amqp'

      QUEUE = 'eventq.work_items'
      WORK_ITEM_CONFIGURATION = '
      {
        "api_version": "1",
        "source_association_key" : "150e8951-19e1-4066-8b74-601026dd6cde",
        "workitem_settings" : {
            "url": "http://www.example.com/jira",
            "event_time": "2012-10-02T17:15:32.320Z",
            "tracker":  {
                            "name": "EventQ/Stories",
                            "id": "01234567abcdef01234567",
                            "key":"ORC",
                            "regex": "ORC-\d+",
                            "icon": "http://www.example.com/jira/browse/bug.jpig",
                            "statuses": [
                                {"name": "Open", "id": "abcdef"},
                                {"name": "In progress", "id": "123abc"},
                                {"name": "Closed", "id": "456123"}
                            ]
                         }
      }
    }'
      # Event loop
      EventMachine.run do
        connection = AMQP.connect('amqp://guest:guest@example-mq')

        # Set up our RabbitMQ information
        channel = AMQP::Channel.new(connection)
        queue = channel.queue(QUEUE, :auto_delete => false, durable: true)
        exchange = channel.direct('')

        # Publish the work item configuration and exit the loop
        exchange.publish WORK_ITEM_CONFIGURATION, :routing_key => queue.name do
          connection.disconnect {EventMachine.stop}
        end
      end