Jira API 返回 Gitlab 问题 link -> 提取有关 Gitlab 问题的更多数据

Jira API returned Gitlab issue link -> extract more data about the Gitlab issue

当使用项目中的 Jira API 到 return 问题时,有一个名为“customfield_12900”的 JSON 字段包含 Gitlab 问题 link.我想这是因为我们将 Jira 与 Gitlab 集成了。但是,link 不是使用 Gitlab API 从中提取数据的有效格式。

URL 的示例可以是“https://gitlab.gildeskagerak.com/ram/ram-platform/main/-/issues/65

我的问题是:如何获取给定的 Gitlab URL 并提取有关给定问题的数据?在本例中,ID 为 65.

使用存储库名称查询 Gitlab API 并从那里开始

curl "https://gitlab.foo.bar/api/v4/projects/?private_token=xxxxx&search=ram-platform"

你应该得到类似

的东西
[
   {
      "path_with_namespace" : "ram/ram-platform",
      "web_url" : "https://gitlab.foo.bar/ram/ram-platform",
      "path" : "ram-platform",
      "service_desk_address" : null,
      "operations_access_level" : "enabled",
      "issues_enabled" : true,
      "readme_url" : null,
      "shared_with_groups" : [],
      "namespace" : {
         "id" : 433,
         "kind" : "group",
         "name" : "ram-platform",
         "full_path" : "ram-platform",
         "avatar_url" : null,
         "web_url" : "https://gitlab.foo.bar/groups/ram-platform",
         "parent_id" : null,
         "path" : "ram-platform"
      },
...
]

从那里获取您的 ID。