Hi Community,
i've got a little problem. When transitioning an issue to a new status, we run a custom script to create subtasks based on different settings.
Creating these subtask works fine, but when i try to log the number of subtasks, I get a 0. What am i missing here?
issueObject.setProjectObject(issue.getProjectObject())
issueObject.setIssueTypeId(issuetypeId)
issueObject.setParentId(issue.getId())
issueObject.setSummary(summary)
issueObject.setAssigneeId(issue.getAssigneeId())
issueObject.setReporter(issue.getReporter())
issueObject.setAffectedVersions(issue.getAffectedVersions())
issueObject.setFixVersions(fixVersions)
issueObject.setDescription(issue.getDescription())
issueObject.setComponent(issue.getComponents())
issueObject.setLabels(issue.getLabels())
issueObject.setPriority(issue.getPriority())
issueObject.setCustomFieldValue(hgruppierung,issue.getCustomFieldValue(hgruppierung))
issueObject.setCustomFieldValue(hHotlinefaelle,issue.getCustomFieldValue(hHotlinefaelle))
issueObject.setCustomFieldValue(hZeitaufwand,issue.getCustomFieldValue(hZeitaufwand))
def issueManager = ComponentAccessor.getIssueManager()
def subTask = issueManager.createIssueObject(users, issueObject)
ComponentAccessor.subTaskManager.createSubTaskIssueLink(issue,subTask,ComponentAccessor.jiraAuthenticationContext.getLoggedInUser())
for(Issue iss: issue.getSubTaskObjects()) //Never enters here
{
log.info(iss.getId())
}
Thanks for your help in advance
Edit: Even a post function later (same transition) another script returns a 0 for the numbers of subtasks. Also reindexing does not work. Seems like all the postfunctions need to be done and some loading needs to be done. No one got an idea?
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.