【问题标题】:BMC Remedy AR system apiBMC Remedy AR系统api
【发布时间】:2020-07-24 04:46:05
【问题描述】:

我正在尝试从事件中提取细节,我设置了

entryListFields = [1000000161, 1000000217, 1000005781];
entry_result = arserver_user.getEntry (form,entry_info_list[0].getEntryID(entryListFields);

然而,这个entry_result不仅返回请求的3个数据字段,而且还带有这些字段:1, 30376000, 303524200, 303524300

当我使用value = entry_result.get (1000000161);

返回“无”

【问题讨论】:

  • 能否再添加一些前面的代码?似乎缺少了什么……我的直觉告诉我,您没有发送您期望的 entryListFileds。附注:据我所知,始终返回字段 1
  • python 没有标准的 API。但是,您的标签表明您正在使用它。如果 Remedy 版本超过 9.1,我会使用 Java,我可以为您指出正确的代码方向,或者使用 REST 接口。然后你就可以使用Python了。

标签: python-3.x remedy bmc itsm


【解决方案1】:

您可以使用 Jython API,它是 AR Java API 的 Python 包装器:

https://communities.bmc.com/docs/DOC-19318

以下是该文档中的一些示例查询代码:

def get_entry():
    """This is how to return a single entry using the getEntry method
    """
    try:
        schema = 'User'  # We define our form here
        entry_id = '000000000000001'  # We define our target entry_id here
 
        # How to return an entry with all fields
        entry = ars.getEntry(schema, entry_id, None)
        print(entry)
 
        # How to return an entry with certain fields (Field ID 1,2,3,4,5 in this scenario)
        entry = ars.getEntry(schema, entry_id, [1, 2, 3, 4, 5])
        print(entry)
 
        # How to loop through and print entry, accounting for null values w/ toString method
        entry = ars.getEntry(schema, entry_id, None)
        for i in entry:
            print '%s: %s' % (i, entry[i].toString())
    except ARException, e:
        print(e)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-22
    • 2020-11-05
    • 1970-01-01
    • 2023-01-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多