0

Rest API を使用して、カスタム フィールドをファイル タイプで更新しようとしています。以下を使用してファイルを適切にアップロードした後:

curl --data-binary "@test.pdf" -H "Content-Type: application/octet-stream" -X POST -H "X-Redmine-API-Key: e1d815b8963e7b3950d4bea47959f874be755a2c" https://redmine-dev/uploads.xml

トークンを取得します:

<?xml version="1.0" encoding="UTF-8"?>
<upload>
  <id>15</id>
  <token>15.cb4...</token>
</upload>

そして、それらを使用してカスタムファイルを更新しようとしましたが、何も機能しませんでした:

<?xml version="1.0"?>
<issue>
  <custom_fields type="array">
    <custom_field id="4">
      <token>15.cb4...</token>
      <filename>test.pdf</filename>
    </custom_field>
  </custom_fields>
</issue>

<?xml version="1.0"?>
<issue>
  <custom_fields type="array">
    <custom_field id="4">
      <value>
        <token>15.cb4...</token>
        <filename>test.pdf</filename>
      </value>
    </custom_field>
  </custom_fields>
</issue>

<?xml version="1.0"?>
<issue>
  <custom_fields type="array">
    <custom_field id="4">
      <value>15</value>
    </custom_field>
  </custom_fields>
</issue>

各フィールドがデータベースでクリアされた後。

それらのそれぞれと一緒に別のカスタム フィールド (テキストおよび数値ベース) を更新することは機能しています。ドキュメントも確認しましたが、REST を使用してカスタム添付ファイルを更新する方法について詳しく説明しているものはありません。

4

1 に答える 1