使用 Jira/Rally 连接器时的自定义字段处理程序语法

Custom field handlers syntax when using the Jira/Rally Connector

我正在研究 Jira/Rally (CA Agile Central) 集成,可以进行基本同步,但是在 Jira 和 Rally 之间同步时,某些字段需要更复杂的转换。

为此,我可以看到 CA Agile Connector (https://help.rallydev.com/jira-installation-user-guide) 为 "custom field handlers" 提供了一些支持,这些支持以 Ruby 编写并遵循如下格式:

# Copyright 2015 CA Technologies.  All Rights Reserved.
require 'rallyeif/wrk/field_handlers/field_handler'

module RallyEIF
  module WRK
    module FieldHandlers
      class MyCustomFieldHandler < OtherFieldHandler
        def initialize(field_name = nil)
          super(field_name)
        end

        # ... more code here ...
      end
    end
  end
end

然而,当我创建该文件并将以下内容添加到我的连接器配置时:

...
<Connector>
    <FieldMapping>
        <Field>
            <Rally>Description</Rally>
            <Other>Description</Other>
            <Direction>TO_RALLY</Direction>
        </Field>
        ...
    </FieldMapping>

    <OtherFieldHandlers>
        <MyCustomFieldHandler>
            <FieldName>Description</FieldName>
        </MyCustomFieldHandler>
    </OtherFieldHandlers>

</Connector>
...

当 运行 连接器出现以下错误:

[2017-08-22 20:25:39 Z] ERROR : RallyEIF::WRK::Connector.rescue in block in read_field_handlers - For RallyEIF::WRK::JiraConnection: Could not find class for MyCustomFieldHandler

文档根本没有提到如何使用自定义处理程序,所以我想知道是否有人使用过此功能并可以分享一些有关如何声明和使用自定义字段处理程序的信息。

我测试了连接器版本 4.7.2,它可以正常工作。要检查的事项:

  • 在调用连接器的文件夹中,必须有一个名为"field_handlers"
  • 的文件夹
  • 在此 "field_handlers" 文件夹中,必须有一个包含 "class MyCustomFieldHandler < ...."
  • 的文件(如上所示)

帮助页面上有一个示例。它适用于 HP-ALM (QC) 而不是 JIRA,但概念是相同的:

到目前为止的想法结束。