diff --git a/src/main/java/com/alertlogic/plugins/jira/cloudinsight/tasks/AutoAssignTask.java b/src/main/java/com/alertlogic/plugins/jira/cloudinsight/tasks/AutoAssignTask.java index 8f17184..e61bd8d 100644 --- a/src/main/java/com/alertlogic/plugins/jira/cloudinsight/tasks/AutoAssignTask.java +++ b/src/main/java/com/alertlogic/plugins/jira/cloudinsight/tasks/AutoAssignTask.java @@ -158,9 +158,9 @@ private void manageRuleException(JSONObject rule,RuleConfig ruleConfig,Exception String exceptionAsString = sw.toString(); //If error happens last important log becomes the previous one. - String lastImportantLog = rule.getString("lastLog"); - String ruleName = rule.getString("name"); - int ruleId = rule.getInt("id"); + String lastImportantLog = rule.has("lastLog") ? rule.getString("lastLog") : "No last log available."; + String ruleName = rule.has("name") ? rule.getString("name") : "No name available."; + int ruleId = rule.has("id") ? rule.getInt("id") : 0; //Is the second time it fails? if (statusBeforeRun == TaskRuleExecutionState.ERROR)