The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

issue.Savechange() throw unknown exception after setting issue priority value.

Ming Liang
April 21, 2021

Hi, guys

The .NET program I used to create Jira issues automatically fails to save the new created issue. But I can create and save a issue manually when I log in Jira in browser. See the attached pics for exception details. What causes this exception? thanks.

JiraException.jpgJira.JPGJira2.JPGJira3.JPG

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 22, 2021

This is something broken in whatever library or application you are using to talk to Jira with.  You'll need to fix your code such that it makes a valid call.  You've not told us what you're using, so we can't tell you much more than that.

Ming Liang
April 22, 2021

The code was working perfectly until April 20, so I guess there was something changed on Jira server side that causes this issue. 

 

 

Atlassian.NET SDK 12.4.0

Jira.JPG

 

Ming Liang
April 27, 2021

Hi

 

The problem is resolved after removing following code, weird.

new_issue.Priority = "None";

 

Should I use priority id instead?

 

How should I know which id to represent the values in the drop list:

None, Highest, High, Medium, Low, Lowest.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
April 27, 2021

It's usually the id you need.  I think you should have a look at the project though, the "change" might be that someone removed priority or changed the priority scheme.

No priority usually means "nothing selected, field is empty" though, which is usually a null, or not sending anything at all.

Ming Liang
April 27, 2021

I tried following two ways to set priority, but they all triggers that exception.

So, what is the correct way to do it in .net code? Thanks.

 

// set priority based on CVSS score
//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
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();

TAGS
AUG Leaders

Atlassian Community Events