csharp JiraClientTest.Program.cs

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp JiraClientTest.Program.cs相关的知识,希望对你有一定的参考价值。

using System;
using System.Linq;
using TechTalk.JiraRestClient;

namespace JiraClientTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var clientX = new JiraClient<MyIssueFields>("http://localhost:8080/", "admin", "test");
            var issueX = clientX.CreateIssue("TEST", "Story", "sub");
            issueX.fields = new MyIssueFields { labels = { "lbl1", "lbl2" }, timetracking = new Timetracking { originalEstimateDays = 2.8m }, description = "detailed description", summary = "summary", customfield_10010 = "custom" };
            issueX = clientX.UpdateIssue(issueX);

            var client = new JiraClient("http://localhost:8080", "test", "test");
            var issue = client.LoadIssue(issueX);

            var link1 = client.CreateRemoteLink(issueX, new RemoteLink { title = "SpecLog", summary = "link", url = "http://speclog.net/" });
            var link2 = client.CreateRemoteLink(issue, new RemoteLink { title = "SpecRun", summary = "link", url = "http://specrun.net/" });

            link1.summary = "speclog link";
            client.UpdateRemoteLink(issue, link1);

            foreach (var link in client.GetRemoteLinks(issue))
                Console.WriteLine("link: {0} ({1}): {2}", link.title, link.summary, link.url);

            client.DeleteRemoteLink(issueX, link2);

            foreach (var comment in clientX.GetComments(issue))
                Console.WriteLine("cmmt: {0}", comment.body);

            var close = clientX.GetTransitions(issue).Single(t => t.name.Contains("Close"));
            close.fields = new { resolution = new { name = "Won't Fix" } };
            client.TransitionIssue(issueX, close);

            clientX.DeleteIssue(issue);
        }
    }

    class MyIssueFields : IssueFields
    {
        public string customfield_10010 { get; set; }
    }
}

以上是关于csharp JiraClientTest.Program.cs的主要内容,如果未能解决你的问题,请参考以下文章

csharp 例如-CSHARP-GroupDocs.Conversion.Examples.CSharp渲染,RenderPSDImageAsPath.cs

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertTopresentationAsPath.cs

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertTopresentationAsPath.cs

csharp 实例-CSHARP-GroupDocs.Conversion.Examples.CSharp变频-ConvertTopresentationAsPath.cs

csharp 例如-CSHARP-GroupDocs.Search.Examples.CSharp索引,AddDocumentToIndex.cs

csharp 例如-CSHARP-GroupDocs.Search.Examples.CSharp索引,AddDocumentToIndexAsynchronously.cs