Issue oldParent = issueOld.getParentObject(); Issue newParent = issueNew.getParentObject(); MutableIssue newParentFromDb = issueManager.getIssueObject(issueNew.getParentObject().getId());
public void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder) { if (issue.isSubTask()) { final Issue parentObject = issue.getParentObject(); // on subtask create its possible that the parent is known on the issue yet if (parentObject != null) { // Set the security field to be the same as the parent issue issue.setSecurityLevel(parentObject.getSecurityLevel()); } } else { if (fieldValueHolder.containsKey(getId())) { issue.setSecurityLevel((GenericValue) getValueFromParams(fieldValueHolder)); } } }
public void preStoreUpdates(JiraServiceContext context, IssueChangeHolder changeHolder, Issue currentIssue, MutableIssue targetIssue) { final Issue parentIssue = targetIssue.getParentObject(); changeHolder.addChangeItem(new ChangeItemBean(ChangeItemBean.STATIC_FIELD, "Parent", null, null, parentIssue.getId().toString(), parentIssue.getKey())); updateTargetIssueSecurityLevel(changeHolder, currentIssue, targetIssue, parentIssue); try { subtaskManager.createSubTaskIssueLink(parentIssue, targetIssue, context.getLoggedInUser()); } catch (CreateException e) { String msg = "Could not create sub-task issue link for '" + targetIssue.getKey() + "' (issue) and '" + parentIssue.getKey() + "' (parent)"; log.error(msg, e); throw new DataAccessException(msg, e); } }
void manageLinks(final MutableIssue issue, final MutableIssue newIssue, final ApplicationUser applicationUser) { // [JRA-13245] subtask->issue - should delete link from parent if (!newIssue.getIssueType().isSubTask() && issue.getIssueType().isSubTask()) { removeLinkFromParent(issue, applicationUser); } //[JRA-13245] issue->subtask - set parent, and add link from the new parent to the currently moved subtask else if (newIssue.getIssueType().isSubTask() && !issue.getIssueType().isSubTask()) { // get the new parent issue addLinkFromNewParent(newIssue, newIssue.getParentObject(), applicationUser); } // subtask->subtask and new parent else if (newIssue.getIssueType().isSubTask() && issue.getIssueType().isSubTask() && !Optional.ofNullable(issue.getParentId()).equals(Optional.ofNullable(newIssue.getParentId()))) { // remove from current parent removeLinkFromParent(issue, applicationUser); //add links from new parent addLinkFromNewParent(newIssue, newIssue.getParentObject(), applicationUser); } }
newIssue.getParentObject().getId(), newIssue.getParentObject().getKey(), issue.getId(), issue.getKey()); log.warn(errorMsg);
final Issue parentIssue = oldIssue.getParentObject(); if( parentIssue!=null ) final Issue parentIssue = newIssue.getParentObject(); if (parentIssue != null) final Optional<Issue> newParentIssue = Optional.ofNullable(newIssue.getParentObject()); final Optional<Issue> oldParentIssue = Optional.ofNullable(oldIssue.getParentObject()); if (oldParentIssue.isPresent() || newParentIssue.isPresent())