public void execute(Map transientVars, Map args, PropertySet ps) { MutableIssue issue = (MutableIssue) transientVars.get("issue"); if (issue == null) { log.warn("Issue is null - cannot store."); return; } try { issue.store(); } catch (Exception e) { log.error("An exception occurred", e); } }
public void execute(Map transientVars, Map args, PropertySet ps) { MutableIssue issue = (MutableIssue) transientVars.get("issue"); issue.setAssignee(issue.getReporter()); // JRA-15120: issue.store() should never have been called in this function, as it can cause the Issue object // to be persisted to the database prematurely. However, since it has been here for a while, removing it could // break existing functionality for lots of users. But, because an NPE is only thrown when this function is used // in the Create step, all we have to do to prevent this error from occuring is check if the issue has already // been stored before. If it has, we can call store() to update the issue, which maintains working (albeit // incorrect) behaviour. If it hasn't, we defer the store() call, as it should have been implemented initially. if (issue.isCreated()) { issue.store(); } } }
public String createChangeItemForIssueLinkIfNeeded(final String issueId, final String issueLinkTypeId, final String linkedIssueKey, final boolean isSource, final ApplicationUser importAuthor) { Assertions.notBlank("issueId", issueId); Assertions.notBlank("issueLinkTypeId", issueLinkTypeId); Assertions.notBlank("linkedIssueKey", linkedIssueKey); final MutableIssue issue = issueManager.getIssueObject(new Long(issueId)); if (issue == null) { // This should not happen, log it and move on log.warn("Attempted to create a change item for an issue link against an issue with id '" + issueId + "' but JIRA could not resolve the issue for that id, no change item will be created."); return null; } final boolean createChangeItem = createIssueLinkChangeItem(linkedIssueKey, issue); if (createChangeItem) { final ChangeItemBean changeItem = getChangeItemBean(issueLinkTypeId, linkedIssueKey, isSource); createChangeItem(importAuthor, issue, changeItem); issue.setUpdated(new Timestamp(System.currentTimeMillis())); issue.store(); return issueId; } return null; }
mutableIssue.store();
@VisibleForTesting void alertSystemOfComment(Comment comment) throws GenericEntityException { final MutableIssue issueObject = getMutableIssue(); issueObject.setUpdated(UtilDateTime.nowTimestamp()); issueObject.store(); // fire a comment event Map<String, Object> params = createIssueEventParameters(); issueEventManager.dispatchRedundantEvent(ISSUE_COMMENTED_ID, issueObject, getLoggedInUser(), comment, null, null, params); IssueEventBundle issueCommentBundle = issueEventBundleFactory.createCommentAddedBundle(issueObject, getLoggedInUser(), comment, params); issueEventManager.dispatchEvent(issueCommentBundle); }
newIssue.store();
targetIssue.store();
targetSubTask.store();
MutableIssue mutableIssue = issueFactory.getIssue(issueGV); mutableIssue.setUpdated(UtilDateTime.nowTimestamp()); mutableIssue.store();
targetSubTask.store();
newIssue.store();