With my issue event listener java plugin for jira 5, i can successfully create a new task. But how can I create a subtask?
IssueInputParameters issueSubtaskParams = issueService.newIssueInputParameters(); issueSubtaskParams.setSummary("Testing..."); ... issueSubtaskParams.setProjectId(issue.getProjectObject().getId()); issueSubtaskParams.setIssueTypeId(issueSubtaskTypeId); CreateValidationResult validationResult = issueService.validateCreate(user, issueInputParameters); IssueService.IssueResult issueResult = issueService.create(user, validationResult); return issueResult.getIssue().getId();
If this creates a task, how can I create a subtask that is parented to another task?
Community moderators have prevented the ability to post new answers.
use validateSubtaskCreate instead of validateCreate.
I scanned the api but missed the validate prefix!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
:) Haven't used it myself but seems like the one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Argh how did I miss that! Thanks! Currently it is creating a subtask, but it is not parented to the original task. I use issueService.validateSubtaskCreate to create the validation with the id (not key, but id) of the main task, and then issueService.create to create it. I saw no subtask function for the latter. Is there any additional params I need to put to parent it to the main task?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Justin, it seems the IssueInputParams doesn't let you set a parentId through the api, I wonder if you can set the parentId in the value map (issueSubtaskParams.getFieldValueHolder())?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.