How to set parent issue when creating a sub-task?

Ben Geng July 11, 2011

I can't find any documentation/sample code to create a sub-task. can somebody shed some light here?

I am trying to create a listener, which creates a group of sub-task once there is a same type of sub-task is created, I assume it is pretty much the same as creating an issue, but just could not find the property name of ParentIssue (ID).

thanks in advance.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 11, 2011

I use the followig in JEMH to setup a subtask. Is this what you needed?

Issue issueObject = ...new issue, set issueType as sub-task
 
Issue parentIssue=(Issue) ... getParent issue.
Project p=parentIssue.getProjectObject();
issueObject.setProject(p.getGenericValue());
issueObject.setParentObject(parentIssue);
issueObject.setParentId(parentIssue.getId());

Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2011

On a meta note - the 'preformatting' style isn't working well here in Answers. I've raised a bug report at ANSWERS-142 for this. We're also working on a proper code block option at ANSWERS-57.

Ben Geng July 11, 2011

Andy,
that's exactly what I need!

thanks a lot!

do you have some documents that I don't have or something? I just could not find anywhere.

Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 11, 2011

@Ben, Um sorry, its all in my head. I should write a book or something :) Checkuot the JEMH code, its a pretty good toolkit for doing most things with/to Jira issues.

@Jermey, thaks, I did spend a goood 30S looking for the 'enough with the rich editor just give me the markup' button, watching -57!

TAGS
AUG Leaders

Atlassian Community Events