2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Redmine REST APIでWikiページ生成時に親ページを指定する方法

Last updated at Posted at 2019-08-06

Redmine Rest API公式ドキュメント

ドキュメントを参考に、以下のようなXMLを作っても

<?xml version="1.0" encoding="UTF-8"?>
<wiki_page>
     <title>hogehoge</title>
     <parent title="hogehoge"/>
     <text>h1. hogehoge</text>
     <version>1</version>
     <author id="x" name="hogehoge"/>
     <comments></comments>
     <created_on>hogehoge</created_on>
     <updated_on></updated_on>
</wiki_page>

実際に送られるXMLは親ページ指定のタグ(parent title)が無視されます

<?xml version="1.0" encoding="UTF-8"?>
<wiki_page>
     <title>hogehoge</title>
     <text>h1. hogehoge</text>
     <version>1</version>
     <author id="x" name="hogehoge"/>
     <comments></comments>
     <created_on>hogehoge</created_on>
     <updated_on></updated_on>
</wiki_page>

この現象について以下のページを参照
http://www.redmine.org/issues/14829
数年前にちゃんとパッチが当たっていました。
このページを参考にXMLを

<?xml version="1.0" encoding="UTF-8"?>
<wiki_page>
     <title>hogehoge</title>
     <parent_title>hogehoge</parent_title>
     <text>h1. hogehoge</text>
     <version>1</version>
     <author id="x" name="hogehoge"/>
     <comments></comments>
     <created_on>hogehoge</created_on>
     <updated_on></updated_on>
</wiki_page>

に修正します。
修正点は以下の部分です。

<parent title="hogehoge"/>
↓
<parent_title>hogehoge</parent_title>

結果、XMLに親ページのタグである、

<parent_title></parent_title>

が含まれて親ページを指定できます。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?