public void convertIssue(JiraServiceContext context, Issue currentIssue, MutableIssue updatedIssue) { // migrate workflow first migrateWorkflowIfNecessary(currentIssue, updatedIssue); // Log and set new details for target updatedIssue.setUpdated(new Timestamp(System.currentTimeMillis())); IssueChangeHolder issueChangeHolder = convertIssueDetails(context, currentIssue, updatedIssue); //create and store the changelog for this whole process GenericValue updateLog = ChangeLogUtils.createChangeGroup(context.getLoggedInUser(), currentIssue, updatedIssue, issueChangeHolder.getChangeItems(), false); if (updateLog != null && !issueChangeHolder.getChangeItems().isEmpty()) { dispatchEvents(updatedIssue, context, updateLog, issueChangeHolder); } }
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.setUpdated(new Timestamp(comment.getUpdated().getTime())); 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); }
issue.setUpdated(UtilDateTime.nowTimestamp());
issue.setUpdated(now);
newIssue.setUpdated(new Timestamp(System.currentTimeMillis()));
private void moveIssueInTxn(Transaction txn, MutableIssue originalIssueObject, MutableIssue updatedIssueObject, String originalWfId) throws GenericEntityException { // Only migrate the issue if the target workflow is different from the current workflow if (!isWorkflowMatch(getCurrentIssueType(), getTargetIssueType())) { migrateIssueToWorkflow(updatedIssueObject, getIssue().getString("type"), getWorkflowForType(getTargetPid(), getTargetIssueType()), getTargetStatus()); } // Log and set new details for target updatedIssueObject.setUpdated(new Timestamp(System.currentTimeMillis())); IssueChangeHolder issueChangeHolder = moveIssueDetails(updatedIssueObject, originalIssueObject.getKey(), originalWfId); //create and store the changelog for this whole process GenericValue updateLog = ChangeLogUtils.createChangeGroup(getLoggedInUser(), originalIssueObject.getGenericValue(), updatedIssueObject.getGenericValue(), issueChangeHolder.getChangeItems(), false); // remember the old issue key so we can do fast URL redirects if (projectIsMoved()) issueManager.recordMovedIssueKey(originalIssueObject); txn.commit(); dispatchIssueUpdateEvents(updatedIssueObject, updateLog, issueChangeHolder); }
targetSubTask.setUpdated(UtilDateTime.nowTimestamp());
GenericValue issueGV = comment.getIssue().getGenericValue(); MutableIssue mutableIssue = issueFactory.getIssue(issueGV); mutableIssue.setUpdated(UtilDateTime.nowTimestamp()); mutableIssue.store();
Issue createIssueForExternalIssue(final ExternalIssue externalIssue) { final MutableIssue issue = issueFactory.getIssue(); issue.setProjectId(new Long(externalIssue.getProject())); issue.setIssueTypeId(externalIssue.getIssueType()); issue.setReporterId(externalIssue.getReporter()); issue.setAssigneeId(externalIssue.getAssignee()); issue.setSummary(externalIssue.getSummary()); issue.setDescription(externalIssue.getDescription()); issue.setEnvironment(externalIssue.getEnvironment()); issue.setPriorityId(externalIssue.getPriority()); issue.setResolutionId(externalIssue.getResolution()); issue.setCreated(toTimeStamp(externalIssue.getCreated())); issue.setUpdated(toTimeStamp(externalIssue.getUpdated())); issue.setDueDate(toTimeStamp(externalIssue.getDuedate())); //NOTE: This HAS to come after the setResolutionId() call, otherwise that will override this date. issue.setResolutionDate(toTimeStamp(externalIssue.getResolutionDate())); issue.setVotes(externalIssue.getVotes()); issue.setOriginalEstimate(externalIssue.getOriginalEstimate()); issue.setTimeSpent(externalIssue.getTimeSpent()); issue.setEstimate(externalIssue.getEstimate()); if (externalIssue.getSecurityLevel() != null) { issue.setSecurityLevelId(new Long(externalIssue.getSecurityLevel())); } return issue; }
private void setNotCloningFieldsToBlankByDefault() { getIssueObject().setCreated(null); getIssueObject().setUpdated(null); getIssueObject().setVotes(null); getIssueObject().setWatches(0L); getIssueObject().setStatus(null); getIssueObject().setWorkflowId(null); // Ensure that the 'time spent' and 'remaining estimated' are not cloned - JRA-7165 // We need to copy the value of 'original estimate' to the value 'remaining estimate' as they must be kept in sync // until work is logged on an issue. getIssueObject().setEstimate(getOriginalIssue().getOriginalEstimate()); getIssueObject().setTimeSpent(null); //JRA-18731: Cloning a resolved issue will result in an open issue. The resolution date should be reset. getIssueObject().setResolutionDate(null); // If the user does not have permission to modify the reporter, initialise the reporter to be the remote user if (!isCanModifyReporter()) { getIssueObject().setReporter(getLoggedInUser()); } }