When I trying to create a subtask issue automatically on creating issue.
I am getting this error.
The Issue is created but subtask issue is not created.
The code is as follow:
protected void createSubTask(Map<String, Object> transientVariables, Map<String, String> args)
{
Issue originalIssue = (Issue)transientVariables.get("issue");
Issue parentIssue = originalIssue;
MutableIssue issueObject =this.issueFactory.getIssue();
issueObject.setIssueTypeObject(this.constantsManager.getIssueTypeObject((String)args.get("field.subIssueTypeId")));
issueObject.setPriorityId(this.constantsManager.getPriorityObject((String)args.get("field.subIssuePriorityId")).getId());
Map params =new HashMap();
params.put("issue", issueObject);
try
{
User user = ComponentManager.getInstance().getJiraAuthenticationContext().getLoggedInUser();
Issue subTask =this.issueManager.createIssueObject(user, params);
this.subTaskManager.createSubTaskIssueLink(parentIssue, subTask, user);
ImportUtils.setIndexIssues(true);
ComponentManager.getInstance().getIndexManager().reIndex(subTask);
}
catch(Exception e)
{
log.error("Unexpected exception", e);
}
ImportUtils.setIndexIssues(false);
}
Thanks for your time Nic and AUser
I am cleared with the error.
The error was due to following statement
issueObject.setPriorityId(this.constantsManager.getPriorityObject((String)args.get("field.subIssuePriorityId")).getId());
It is returning null and abnormally terminating the execution.
You don't say what error you are getting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that's about as useful an answer as me building a tree for my imaginary penguin.
Where does the error occur and what debugging have you done and what were the results?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I havent done anything, bcause I am not the the user who posted that question!
There is a missing "?" behind my comment, because i wantet to know if this is the exception or one of his data is null.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bharadwaj - excellent, thank you for
AUser - it's great to want to contribute, but being completely unclear really doesn't help. Even with a ? on the end, you're simply prompting the response of "yes", which gets us nowhere.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.