How to search the JIRA XML backup with XPath

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

目的

This article shows some of the ways a JIRA XML backup can be easily searched using XPath (basically SQL for XML).

ソリューション

In this example we're going to search for a specific label in JIRA. This is stored under the Label entity in the XML file. Some sample data is below, and this KB is written using Linux command line with a tool called xmllint. There may be other tools for Windows that can be used instead of xmllint.

    <Label id="10000" issue="11347" label="agatha_christie"/>
    <Label id="10001" issue="11347" label="you&apos;re"/>
    <Label id="10002" issue="11347" label="my"/>
    <Label id="10003" issue="11347" label="hero"/>
  1. Unzip the compressed backup ZIP with your favourite unarchive tool.
  2. Use xmllint to search the file using the XPath. In this example we're searching for the 'hero' label in JIRA.

    xmllint --xpath '//Label[@label="hero"]' entities.xml                                                                      ⏎

    (info) This searches for the XML  'Label', with the name 'hero'.

  3. This returns the below results:

    <Label id="10003" issue="11347" label="hero"/>

And there we have it! Using xmllint you can search for specific XML criteria with a Linux command-line. If you wish to search for other things the XPath search criteria can be changed as per step 2.

最終更新日 2016 年 5 月 15 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.