Skip to content

Commit 8a9417b

Browse files
committed
Add better support for null 'resolution' fields
1 parent 1837fc3 commit 8a9417b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

GUI/MainForm.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ private void GetMessage()
287287
JiraReporterTextBox.Text = bugCmd.Reporter;
288288
JiraAssigneeTextBox.Text = bugCmd.Assignee;
289289
JiraStatusTextBox.Text = bugCmd.Status;
290-
JiraResolutionTextBox.Text = string.IsNullOrEmpty(bugCmd.Resolution) ?
291-
"Unresolved" : bugCmd.Resolution;
290+
JiraResolutionTextBox.Text = bugCmd.Resolution;
292291
JiraDescriptionTextBox.Text = bugCmd.Description;
293292
}
294293
}

MsgTrans.Library/BugCommand.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ public override bool Handle(MessageContext context,
8484
reporter = json["fields"]["reporter"]["displayName"].ToString();
8585
assignee = json["fields"]["assignee"]["displayName"].ToString();
8686
status = json["fields"]["status"]["name"].ToString();
87-
resolution = json["fields"]["resolution"].ToString();
87+
if (json["fields"]["resolution"].HasValues)
88+
{
89+
resolution = json["fields"]["resolution"]["name"].ToString();
90+
}
91+
else
92+
{
93+
resolution = "Unresolved";
94+
}
8895
description = json["fields"]["description"].ToString();
8996

9097
MsgType = MessageType.BugUrl;

0 commit comments

Comments
 (0)