我使用下面的SDK通过C#,
与JIRA互动https://bitbucket.org/farmas/atlassian.net-sdk/wiki/Home
故障单创建成功,响应显示在提示故障单ID的控制台中,但我找不到将故障单ID加载到变量的方法。
var settings = new JiraRestClientSettings()
{
EnableRequestTrace = true
};
var jira = Jira.CreateRestClient("https://testjira.xxxxxxxx.com/",
jiraUsername, jiraPWD, settings);
var issue = jira.CreateIssue("TMS");
issue.Type = "Service Desk Incident";
issue.Summary = "Test issue created via API 3";
issue.Description = "Test issue created via API 3";
issue["Service Desk Priority"] = "Level 3";
await issue.SaveChangesAsync();
我需要做的就是在变量中捕获此ID。 在此先感谢:)
答案 0 :(得分:1)
查看bitbucket中的源代码,可以看出,它返回一个Issue
对象
public async Task<Issue> SaveChangesAsync(CancellationToken token = default(CancellationToken))
所以,你所需要的只是:
var jiraIssue = await issue.SaveChangesAsync();
jiraIssue.Key
是您新创建的密钥。