UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

UIP TM 自定义字段

“uip tm 自定义字段”的语法和选项,用于管理 Test Manager 租户上的自定义字段定义、显示标签和允许的值。

uip tm customfield管理 Test Manager 租户的自定义字段定义。自定义字段使用项目特定的元数据扩展测试用例和需求实体。此命令组包含三个子组:

  • customfield — 管理字段定义本身(列出、获取、创建、更新、删除)
  • customfield label — 管理应用于对象的标签分配
  • customfield value — 管理字段允许的值
重要提示:

字段定义的主要标识符为--field-id 。标签和值命令按--object-type--object-id--label-id--value-id的组合作用域。标志--customfield-id在 v1.196 中不存在。

大纲

# Field definitions
uip tm customfield list --project-key <key> [--object-types <types...>] [--data-types <types...>] [--name <name>] [--filter <text>] [--sort-by <expr>] [--limit <n>] [--offset <n>]
uip tm customfield get --object-type <type> (--field-id <uuid> | --name <name>)
uip tm customfield create --project-key <key> --name <name> --object-type <type> --data-type <type> [--scope-list <list>] [--description <text>] [--default-value <value>] [--value-hints <hints>]
uip tm customfield update --object-type <type> (--field-id <uuid> | --name <name>) [--rename-to <name>] [--description <text>] [--default-value <value>] [--value-hints <hints>] [--scope-list <list>]
uip tm customfield delete --object-type <type> (--field-ids <uuid...> | --name <name>) [-y]

# Labels
uip tm customfield label get --object-type <type> --label-id <uuid>
uip tm customfield label list --object-type <type> [--object-id <uuid>] [--limit <n>] [--offset <n>]
uip tm customfield label create --object-type <type> --object-id <uuid> --values <json>
uip tm customfield label add --object-type <type> --custom-field-name <name> --object-ids <uuid...> --values <values...>
uip tm customfield label remove --object-type <type> --custom-field-name <name> --object-ids <uuid...> (--values <values...> | --remove-all-values)

# Values
uip tm customfield value list --object-type <type> [--object-id <uuid>] [--limit <n>] [--offset <n>]
uip tm customfield value get --object-type <type> (--value-id <uuid> | --name <name> --object-id <uuid>)
uip tm customfield value create --object-type <type> --name <name> --object-id <uuid> --data-type <type> --value <value>
uip tm customfield value update --object-type <type> (--value-id <uuid> | --name <name> --object-id <uuid>) --value <value> [--clear]
uip tm customfield value delete --object-type <type> (--value-id <uuid> | --name <name> --object-id <uuid>) [-y]
# Field definitions
uip tm customfield list --project-key <key> [--object-types <types...>] [--data-types <types...>] [--name <name>] [--filter <text>] [--sort-by <expr>] [--limit <n>] [--offset <n>]
uip tm customfield get --object-type <type> (--field-id <uuid> | --name <name>)
uip tm customfield create --project-key <key> --name <name> --object-type <type> --data-type <type> [--scope-list <list>] [--description <text>] [--default-value <value>] [--value-hints <hints>]
uip tm customfield update --object-type <type> (--field-id <uuid> | --name <name>) [--rename-to <name>] [--description <text>] [--default-value <value>] [--value-hints <hints>] [--scope-list <list>]
uip tm customfield delete --object-type <type> (--field-ids <uuid...> | --name <name>) [-y]

# Labels
uip tm customfield label get --object-type <type> --label-id <uuid>
uip tm customfield label list --object-type <type> [--object-id <uuid>] [--limit <n>] [--offset <n>]
uip tm customfield label create --object-type <type> --object-id <uuid> --values <json>
uip tm customfield label add --object-type <type> --custom-field-name <name> --object-ids <uuid...> --values <values...>
uip tm customfield label remove --object-type <type> --custom-field-name <name> --object-ids <uuid...> (--values <values...> | --remove-all-values)

# Values
uip tm customfield value list --object-type <type> [--object-id <uuid>] [--limit <n>] [--offset <n>]
uip tm customfield value get --object-type <type> (--value-id <uuid> | --name <name> --object-id <uuid>)
uip tm customfield value create --object-type <type> --name <name> --object-id <uuid> --data-type <type> --value <value>
uip tm customfield value update --object-type <type> (--value-id <uuid> | --name <name> --object-id <uuid>) --value <value> [--clear]
uip tm customfield value delete --object-type <type> (--value-id <uuid> | --name <name> --object-id <uuid>) [-y]

所有动词都遵循全局选项和标准退出代码。每个动词接受 --log-level <level>(默认值 Information)。


字段定义命令

UIP TM 自定义字段列表

列出项目中的自定义字段定义。必须填写--project-key

选项
  • --project-key <key> (必填) — 拥有项目。
  • --object-types <types...> — 要作为筛选依据的以空格分隔的对象类型。
  • --data-types <types...> — 要作为筛选依据的空格分隔的数据类型。
  • --name <name> — 按确切字段名称筛选。
  • --filter <text> — 自由文本搜索。
  • --sort-by <expr> — 排序表达式。
  • --limit <n> — 页面大小。默认为50
  • --offset <n> — 要跳过的结果。默认为0
示例
uip tm customfield list \
  --project-key DEMO \
  --object-types TestCase
uip tm customfield list \
  --project-key DEMO \
  --object-types TestCase
数据形状
{
  "Code": "CustomFieldList",
  "Data": [
    {
      "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
      "Name": "Priority",
      "ObjectType": "TestCase",
      "DataType": "String"
    }
  ]
}
{
  "Code": "CustomFieldList",
  "Data": [
    {
      "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
      "Name": "Priority",
      "ObjectType": "TestCase",
      "DataType": "String"
    }
  ]
}

UIP TM 自定义字段获取

获取单个自定义字段定义。

选项
  • --object-type <type> (必填项) — 字段所属的对象类型。
  • --field-id <uuid> — 字段 UUID。与--name互斥。
  • --name <name> — 字段名称。与--field-id互斥。
示例
uip tm customfield get \
  --object-type TestCase \
  --field-id c1b2c3d4-0000-0000-0000-000000000001
uip tm customfield get \
  --object-type TestCase \
  --field-id c1b2c3d4-0000-0000-0000-000000000001
数据形状
{
  "Code": "CustomFieldGet",
  "Data": {
    "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Priority",
    "ObjectType": "TestCase",
    "DataType": "String"
  }
}
{
  "Code": "CustomFieldGet",
  "Data": {
    "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Priority",
    "ObjectType": "TestCase",
    "DataType": "String"
  }
}

UIP TM 自定义字段创建

创建新的自定义字段定义。

选项
  • --project-key <key> (必填) — 拥有项目。
  • --name <name> (必填) — 字段名称。
  • --object-type <type> (必填) — 用于附加字段的对象类型(例如TestCaseTestSet )。
  • --data-type <type> (必填) — 字段的数据类型(例如, StringIntegerBoolean )。
  • --scope-list <list> — 字段的作用域限制。
  • --description <text> — 字段说明。
  • --default-value <value> — 新对象的默认值。
  • --value-hints <hints> — 字段允许的值提示或枚举。
示例
uip tm customfield create \
  --project-key DEMO \
  --name "Priority" \
  --object-type TestCase \
  --data-type String \
  --value-hints "Low,Medium,High"
uip tm customfield create \
  --project-key DEMO \
  --name "Priority" \
  --object-type TestCase \
  --data-type String \
  --value-hints "Low,Medium,High"
数据形状
{
  "Code": "CustomFieldCreate",
  "Data": {
    "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Priority",
    "ObjectType": "TestCase",
    "DataType": "String"
  }
}
{
  "Code": "CustomFieldCreate",
  "Data": {
    "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Priority",
    "ObjectType": "TestCase",
    "DataType": "String"
  }
}

UIP TM 自定义字段更新

更新现有自定义字段定义。

选项
  • --object-type <type> (必填项) — 字段所属的对象类型。
  • --field-id <uuid> — 字段 UUID。与--name互斥。
  • --name <name> — 字段名称(用于查找)。与--field-id互斥。
  • --rename-to <name> — 字段的新名称。
  • --description <text> — 新说明。
  • --default-value <value> — 新的默认值。
  • --value-hints <hints> — 新的允许值提示。
  • --scope-list <list> — 新的作用域限制。
示例
uip tm customfield update \
  --object-type TestCase \
  --field-id c1b2c3d4-0000-0000-0000-000000000001 \
  --rename-to "Severity"
uip tm customfield update \
  --object-type TestCase \
  --field-id c1b2c3d4-0000-0000-0000-000000000001 \
  --rename-to "Severity"
数据形状
{
  "Code": "CustomFieldUpdate",
  "Data": {
    "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Severity",
    "Result": "Updated"
  }
}
{
  "Code": "CustomFieldUpdate",
  "Data": {
    "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Severity",
    "Result": "Updated"
  }
}

UIP TM 自定义字段删除

删除一个或多个自定义字段定义。

选项
  • --object-type <type> (必填项) — 字段所属的对象类型。
  • --field-ids <uuid...> — 要删除的字段 UUID(以空格分隔)。与--name互斥。
  • --name <name> — 要删除的字段名称。与--field-ids互斥。
  • -y, --yes — 跳过确认提示。
示例
uip tm customfield delete \
  --object-type TestCase \
  --field-ids c1b2c3d4-0000-0000-0000-000000000001 \
  --yes
uip tm customfield delete \
  --object-type TestCase \
  --field-ids c1b2c3d4-0000-0000-0000-000000000001 \
  --yes
数据形状
{
  "Code": "CustomFieldDelete",
  "Data": {
    "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
    "Result": "Deleted"
  }
}
{
  "Code": "CustomFieldDelete",
  "Data": {
    "FieldId": "c1b2c3d4-0000-0000-0000-000000000001",
    "Result": "Deleted"
  }
}

标签命令

uip tm 自定义字段标签获取

按 UUID 获取单个标签分配。

选项
  • --object-type <type> (必填项) — 标签所属的对象类型。
  • --label-id <uuid> (必填) — 标签分配的 UUID(而非标签名称)。
示例
uip tm customfield label get \
  --object-type TestCase \
  --label-id l1b2c3d4-0000-0000-0000-000000000001
uip tm customfield label get \
  --object-type TestCase \
  --label-id l1b2c3d4-0000-0000-0000-000000000001
数据形状
{
  "Code": "CustomFieldLabelGet",
  "Data": {
    "LabelId": "l1b2c3d4-0000-0000-0000-000000000001",
    "ObjectType": "TestCase",
    "Label": "Priority"
  }
}
{
  "Code": "CustomFieldLabelGet",
  "Data": {
    "LabelId": "l1b2c3d4-0000-0000-0000-000000000001",
    "ObjectType": "TestCase",
    "Label": "Priority"
  }
}

uip tm 自定义字段标签列表

列出对象类型的标签分配,并可以选择将范围缩小到特定对象。

选项
  • --object-type <type> (必填) — 要为其列出标签的对象类型。
  • --object-id <uuid> — 筛选出特定对象 UUID。
  • --limit <n> — 页面大小。默认为50
  • --offset <n> — 要跳过的结果。默认为0
示例
uip tm customfield label list \
  --object-type TestCase \
  --object-id a1b2c3d4-0000-0000-0000-000000000001
uip tm customfield label list \
  --object-type TestCase \
  --object-id a1b2c3d4-0000-0000-0000-000000000001
数据形状
{
  "Code": "CustomFieldLabelList",
  "Data": [
    {
      "LabelId": "l1b2c3d4-0000-0000-0000-000000000001",
      "ObjectId": "a1b2c3d4-0000-0000-0000-000000000001",
      "Label": "Priority"
    }
  ]
}
{
  "Code": "CustomFieldLabelList",
  "Data": [
    {
      "LabelId": "l1b2c3d4-0000-0000-0000-000000000001",
      "ObjectId": "a1b2c3d4-0000-0000-0000-000000000001",
      "Label": "Priority"
    }
  ]
}

uip tm 自定义字段标签创建

在对象上创建新标签。

选项
  • --object-type <type> (必填) — 要将标签附加到的对象类型。
  • --object-id <uuid> (必填) — 要标记的对象的 UUID。
  • --values <json> (必填) — 要应用的标签值 JSON 数组。
示例
uip tm customfield label create \
  --object-type TestCase \
  --object-id a1b2c3d4-0000-0000-0000-000000000001 \
  --values '[{"name":"Priority","value":"High"}]'
uip tm customfield label create \
  --object-type TestCase \
  --object-id a1b2c3d4-0000-0000-0000-000000000001 \
  --values '[{"name":"Priority","value":"High"}]'
数据形状
{
  "Code": "CustomFieldLabelCreate",
  "Data": {
    "ObjectId": "a1b2c3d4-0000-0000-0000-000000000001",
    "Result": "Created"
  }
}
{
  "Code": "CustomFieldLabelCreate",
  "Data": {
    "ObjectId": "a1b2c3d4-0000-0000-0000-000000000001",
    "Result": "Created"
  }
}

UIP TM 自定义字段标签添加

为命名自定义字段的一个或多个对象添加标签值。

选项
  • --object-type <type> (必填) — 对象类型。
  • --custom-field-name <name> (必填) — 自定义字段的名称。
  • --object-ids <uuid...> (必填) — 要应用标签的对象 UUID,以空格分隔。
  • --values <values...> (必填) — 要添加的以空格分隔的标签值。
示例
uip tm customfield label add \
  --object-type TestCase \
  --custom-field-name Priority \
  --object-ids a1b2c3d4-0000-0000-0000-000000000001 \
  --values High
uip tm customfield label add \
  --object-type TestCase \
  --custom-field-name Priority \
  --object-ids a1b2c3d4-0000-0000-0000-000000000001 \
  --values High
数据形状
{
  "Code": "CustomFieldLabelAdd",
  "Data": {
    "Result": "Added"
  }
}
{
  "Code": "CustomFieldLabelAdd",
  "Data": {
    "Result": "Added"
  }
}

uip tm 自定义字段标签删除

从命名自定义字段的一个或多个对象中移除标签值。

选项
  • --object-type <type> (必填) — 对象类型。
  • --custom-field-name <name> (必填) — 自定义字段的名称。
  • --object-ids <uuid...> (必填项) — 以空格分隔的对象 UUID。
  • --values <values...> — 要删除的以空格分隔的标签值。
  • --remove-all-values — 从指定对象中删除此字段的所有标签值。与--values互斥。
示例
uip tm customfield label remove \
  --object-type TestCase \
  --custom-field-name Priority \
  --object-ids a1b2c3d4-0000-0000-0000-000000000001 \
  --values High
uip tm customfield label remove \
  --object-type TestCase \
  --custom-field-name Priority \
  --object-ids a1b2c3d4-0000-0000-0000-000000000001 \
  --values High
数据形状
{
  "Code": "CustomFieldLabelRemove",
  "Data": {
    "Result": "Removed"
  }
}
{
  "Code": "CustomFieldLabelRemove",
  "Data": {
    "Result": "Removed"
  }
}

值命令

UIP TM 自定义字段值列表

列出对象类型的自定义字段值,可以选择将范围缩小到特定对象。

选项
  • --object-type <type> (必填) — 对象类型。
  • --object-id <uuid> — 筛选出特定对象 UUID。
  • --limit <n> — 页面大小。默认为50
  • --offset <n> — 要跳过的结果。默认为0
示例
uip tm customfield value list \
  --object-type TestCase \
  --object-id a1b2c3d4-0000-0000-0000-000000000001
uip tm customfield value list \
  --object-type TestCase \
  --object-id a1b2c3d4-0000-0000-0000-000000000001
数据形状
{
  "Code": "CustomFieldValueList",
  "Data": [
    {
      "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
      "Name": "Priority",
      "Value": "High"
    }
  ]
}
{
  "Code": "CustomFieldValueList",
  "Data": [
    {
      "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
      "Name": "Priority",
      "Value": "High"
    }
  ]
}

获取 UIP TM 自定义字段值

获取单个自定义字段值。

选项
  • --object-type <type> (必填) — 对象类型。
  • --value-id <uuid> — 值 UUID。与--name + --object-id互斥。
  • --name <name> — 字段名称。与--object-id一起使用。
  • --object-id <uuid> — 对象 UUID。与--name一起使用。
示例
uip tm customfield value get \
  --object-type TestCase \
  --value-id v1b2c3d4-0000-0000-0000-000000000001
uip tm customfield value get \
  --object-type TestCase \
  --value-id v1b2c3d4-0000-0000-0000-000000000001
数据形状
{
  "Code": "CustomFieldValueGet",
  "Data": {
    "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Priority",
    "Value": "High"
  }
}
{
  "Code": "CustomFieldValueGet",
  "Data": {
    "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Priority",
    "Value": "High"
  }
}

UIP TM 自定义字段值创建

设置对象的自定义字段值。

选项
  • --object-type <type> (必填) — 对象类型。
  • --name <name> (必填) — 自定义字段名称。
  • --object-id <uuid> (必填项) — 对象 UUID。
  • --data-type <type> (必填) — 值的数据类型(例如, StringInteger )。
  • --value <value> (必填) — 要设置的值。
示例
uip tm customfield value create \
  --object-type TestCase \
  --name Priority \
  --object-id a1b2c3d4-0000-0000-0000-000000000001 \
  --data-type String \
  --value High
uip tm customfield value create \
  --object-type TestCase \
  --name Priority \
  --object-id a1b2c3d4-0000-0000-0000-000000000001 \
  --data-type String \
  --value High
数据形状
{
  "Code": "CustomFieldValueCreate",
  "Data": {
    "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Priority",
    "Value": "High"
  }
}
{
  "Code": "CustomFieldValueCreate",
  "Data": {
    "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
    "Name": "Priority",
    "Value": "High"
  }
}

更新 UIP TM 自定义字段值

更新现有自定义字段值。

选项
  • --object-type <type> (必填) — 对象类型。
  • --value-id <uuid> — 值 UUID。与--name + --object-id互斥。
  • --name <name> — 字段名称。与--object-id一起使用。
  • --object-id <uuid> — 对象 UUID。与--name一起使用。
  • --value <value> (必填) — 新值。
  • --clear — 清除值而不是设置值。
示例
uip tm customfield value update \
  --object-type TestCase \
  --value-id v1b2c3d4-0000-0000-0000-000000000001 \
  --value Critical
uip tm customfield value update \
  --object-type TestCase \
  --value-id v1b2c3d4-0000-0000-0000-000000000001 \
  --value Critical
数据形状
{
  "Code": "CustomFieldValueUpdate",
  "Data": {
    "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
    "Value": "Critical",
    "Result": "Updated"
  }
}
{
  "Code": "CustomFieldValueUpdate",
  "Data": {
    "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
    "Value": "Critical",
    "Result": "Updated"
  }
}

UIP TM 自定义字段值删除

删除自定义字段值。

选项
  • --object-type <type> (必填) — 对象类型。
  • --value-id <uuid> — 值 UUID。与--name + --object-id互斥。
  • --name <name> — 字段名称。与--object-id一起使用。
  • --object-id <uuid> — 对象 UUID。与--name一起使用。
  • -y, --yes — 跳过确认提示。
示例
uip tm customfield value delete \
  --object-type TestCase \
  --value-id v1b2c3d4-0000-0000-0000-000000000001 \
  --yes
uip tm customfield value delete \
  --object-type TestCase \
  --value-id v1b2c3d4-0000-0000-0000-000000000001 \
  --yes
数据形状
{
  "Code": "CustomFieldValueDelete",
  "Data": {
    "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
    "Result": "Deleted"
  }
}
{
  "Code": "CustomFieldValueDelete",
  "Data": {
    "ValueId": "v1b2c3d4-0000-0000-0000-000000000001",
    "Result": "Deleted"
  }
}

  • requirements — 要求可以包含自定义字段值。
  • 测试用例— 测试用例可以携带自定义字段值。

另请参阅

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新