C# Jira.NET SDK:issue.Savechange()引发未知异常

C# Jira.NET SDK:issue.Savechange()引发未知异常,c#,.net,jira,jira-rest-api,jira-agile,C#,.net,Jira,Jira Rest Api,Jira Agile,我用来创建Jira问题的.NET程序最近自动保存新创建的问题失败。直到几天前,这个工具还可以正常工作,所以我想问题可能出在Jira服务器端。有关例外情况的详细信息,请参阅所附图片。是什么导致了这种异常?谢谢 删除以下代码后,问题得到解决,奇怪。 //新问题。优先级=“无” 我尝试了以下方法来设置优先级,但它们都会触发异常 var new_issue = jira.CreateIssue("THINPRO"); new_issue.Components.Add("Se

我用来创建Jira问题的.NET程序最近自动保存新创建的问题失败。直到几天前,这个工具还可以正常工作,所以我想问题可能出在Jira服务器端。有关例外情况的详细信息,请参阅所附图片。是什么导致了这种异常?谢谢


删除以下代码后,问题得到解决,奇怪。
//新问题。优先级=“无”

我尝试了以下方法来设置优先级,但它们都会触发异常

var new_issue = jira.CreateIssue("THINPRO");
new_issue.Components.Add("Security");
new_issue.Type = "Bug";
new_issue.Summary = "test;
new_issue.Description = "test;

/ set priority based on CVSS score use priority id
//1 = Highest 2 = High 3 = Medium 4 = Low 5 = Lowest 6 = (not used) 7 = None
if (score <= 0.0)
new_issue.Priority = "7";
else if (score >= 7.0)
new_issue.Priority = "2" ;
else if (score <= 4.0)
new_issue.Priority = "4";
else
new_issue.Priority = "3";

new_issue.SaveChanges();

 

// set priority based on CVSS score use priority name
if (score <= 0.0)
new_issue.Priority = "None";
else if (score >= 7.0)
new_issue.Priority = "High";
else if (score <= 4.0)
new_issue.Priority = "Low";
else
new_issue.Priority = "Medium";
new_issue.SaveChanges();





Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.Security.Authentication.AuthenticationException: Response Content: 
   at Atlassian.Jira.Remote.JiraRestClient.GetValidJsonFromResponse(IRestRequest request, IRestResponse response)
   at Atlassian.Jira.Remote.JiraRestClient.<ExecuteRequestAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Atlassian.Jira.Remote.JiraRestClient.<ExecuteRequestAsync>d__10`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Atlassian.Jira.Remote.IssuePriorityService.<GetPrioritiesAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Atlassian.Jira.IssuePriority.<GetEntitiesAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Atlassian.Jira.JiraNamedEntity.<LoadIdAndNameAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Atlassian.Jira.Issue.<ToRemoteAsync>d__158.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Atlassian.Jira.Issue.SaveChanges()
var new_issue=jira.CreateIssue(“THINPRO”);
新发行的组件添加(“安全”);
new_issue.Type=“Bug”;
new_issue.Summary=“测试;
新的_issue.Description=“测试;
/根据CVSS分数设置优先级使用优先级id
//1=最高2=高3=中等4=低5=最低6=(未使用)7=无
如果(分数=7.0)
新问题。优先级=“2”;
否则如果(得分值None可能是无效值


在大多数(和默认)Jira配置中,您不能清空优先级字段。它是系统字段,必须具有预定义列表中的值(通常是阻塞、关键、主要、次要、次要).

您是否正确地进行了身份验证?是的。我想是的。在出现此异常之前,该工具成功地完成了Jira查询。(Jira.Issues.GetIssuesFromJqlAsync(jql,itemsPerPage,startAt);)请提供一个解决方案。删除以下代码后,问题得到解决,奇怪。//new\u issue.Priority=“None”;请始终复制并粘贴代码的相关部分,而不是被异常方法重叠的屏幕截图。这有助于其他人帮助您。谢谢。请查看更新的图片和代码示例。