Ceptah Bridge > Operations guide >

Ceptah Bridge can be controlled from VBA in MS Project or from an external application using its API.

To get access to the API, do the following:

  1. Open the VBA editor, select Tools > References... and add a reference to MspJiraBridge_Api.

  2. Use the code below to retrieve the root object of the API.

    Dim api As ICeptahBridge
    Set api = Application.COMAddIns.Item("MspJiraBridge.AddinModule").Object

The API exposes the following methods:

The properties and methods of the ProjectSettings object can be inspected in the Object Browser. To configure collections, use SetXXX methods. To access collections, use GetXXX methods. To create elements for the collections, use the CreateXXX methods. For instance, to read links call GetLinks ProjectSettings.Mappings.GetLinks, to update links, call ProjectSettings.Mappings.SetLinks, and to create an entry for the collection, call CreateLink.

The following example creates a new set of settings from scratch, imports all issues from a JIRA project into the active project and then saves the settings in a file. The project does not need to have any mappings configured.

Sub Import()
  Dim api As ICeptahBridge
  Set api = Application.COMAddIns.Item("MspJiraBridge.AddinModule").Object
  Dim settings As ProjectSettings
  Set settings = api.GetBlankSettings()
  settings.Mappings.IssueKeyField = "Text10"
  settings.Mappings.SummaryMappingMethod = SummaryMappingMethod_Name
  settings.Mappings.DefaultProjectKey = "CTP"
  settings.Mappings.DefaultPriority = "Intermediate"
  settings.Mappings.DefaultIssueType = "Task"
  Dim statuses(0) As String
  statuses(0) = "In Progress"
  Dim changeLog(0) As ChangeLogEntryMapping
  Set changeLog(0) = settings.Mappings.CreateChangeLogEntry()
  changeLog(0).Field = "status"
  changeLog(0).SetTo statuses
  changeLog(0).CreatedTaskField = "Start"
  changeLog(0).IsFirst = True
  changeLog(0).AsDate = True
  settings.Mappings.SetChangeLog changeLog
  settings.ImportMode = ImportListMode_Project
  settings.ImportProjectKey = "CTP"
  api.Import settings, False
  api.ExportSettings settings, "c:\temp\Settings.xml"
End Sub

Copyright 2013 Ceptah Solutions