I am creating an issue automatically using script post function in a transition. How to I set the parent issue for it. Like we have issue.getParentObject() to get the parent id, is there any method to set the parent id?
You have not told us exactly how you are creating the sub-task, or why, but assuming you are creating a subtask on the issue that the post-function is running against, the minimal calls you need are
newSubTask.setSummary("A summary")
newSubTask.setParentObject(issue)
newSubTask.setProjectObject(issue.getProjectObject())
newSubTask.setIssueTypeId(subTaskTypeId)
You'll need to provide the subTaskTypeId in there, I can't guess what type you might need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.