5

TFS 2010 Power Tools コマンド ライン ユーティリティ TFPT を使用して、新しい WorkItem の説明フィールドに改行を追加するにはどうすればよいですか? 私はこれを試しました:

Z:\>tfpt workitem /new "Project Ipsum\Issue" /collection:http://myserver:8080/tfs/test /fields:"Title=Testing Command Line 3;Description=Description of issue goes here<br /><br />I'd like to have line breaks too"

この:

Z:\>tfpt workitem /new "Project Ipsum\Issue" /collection:http://myserver:8080/tfs/test /fields:"Title=Testing Command Line 3;Description=Description of issue goes here\r\nI'd like to have line breaks too"

無駄に。

何か提案はありますか?

============================

私が実装した 1 つの回避策は、最初に長い説明に埋め込んでいたプロパティを持つ新しい (実際には拡張された) ワークアイテムを作成することです。そのため、次のような個別のフィールドに分割しました。

Z:\>tfpt workitem /new "Project Ipsum\Issue" /collection:http://myserver:8080/tfs/test /fields:"Title=Testing Command Line 3;Description=Description of issue goes here;Field1=more info;Field2=even more data"

次に、それらを表示するフォーム フィールド (新しいタブ グループ) を作成しました。その方がとにかくすっきりします。

TFPTで改行を追加する方法を決定することはまだ興味深いでしょう。

ありがとう。

4

3 に答える 3

1

tfpt を使用してあなたを助ける方法がわかりません。
代わりに TFS-SDK を使用する小さなコンソール アプリケーションを構築し、次のようにジョブを実行できます。

using System;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;

namespace GenerateWorkItem
{
    class Program
    {
        static void Main(string[] args)
        {
            TfsTeamProjectCollection tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://myserver:8080"));
            WorkItemStore workItemStore = (WorkItemStore)tpc.GetService(typeof(WorkItemStore));

            Project teamProject = workItemStore.Projects["Ipsum"];
            WorkItemType workItemType = teamProject.WorkItemTypes["Issue"];

            WorkItem Issue = new WorkItem(workItemType)
            {
                Title = "Testing Command Line 3",
                Description = "Description of issue goes here \n I'd like to have line breaks too"
            }
            ;
            Issue.Save();
        }
    }
}

これで仕事は完了です。に依存させるとstring[] args、 @Ludwo が提示したメソッドが使用できるようになると思います。

上記はこれに基づいています。

于 2011-11-03T16:14:36.603 に答える
0

これを回答としてマークするのは嫌いですが、私にとってはうまくいく回避策を追加しました。OPの問題に「解決策」を追加しましたが。わかりやすくするためにここにあります(pantelifという概念に感謝します)

私が実装した 1 つの回避策は、最初に長い説明に埋め込んでいたプロパティを持つ新しい (実際には拡張された) ワークアイテムを作成することです。そのため、次のような個別のフィールドに分割しました。

Z:\>tfpt workitem /new "Project Ipsum\Issue" /collection:http://myserver:8080/tfs/test /fields:"Title=Testing Command Line 3;Description=Description of issue goes here;Field1=more info;Field2=even more data"

次に、それらを表示するフォーム フィールド (新しいタブ グループ) を作成しました。その方がとにかくすっきりします。

TFPTで改行を追加する方法を決定することはまだ興味深いでしょう。

于 2011-11-03T16:52:52.263 に答える