가이드 제목은 [도구명] [내용]-하기 형태(ex Bitbucket Cloud 저장소 생성하기)로 입력한다.

이 문서에 대한 요약 /개요를 입력한다. (구글에서 검색되었을때 표시되는 문장)

이 문서는 Java에서 Jira 이슈를 생성하는 방법을 공유하기 위해 작성되었다.


가이드에 사용되는 도구 정보를 입력한다.

도구명Jira
버전8.22





첨부한  이미지 너비는 800px 을 넘기지 않는다.

IssueService api 적용

issueService api 불러오기

@ComponentImport
    private final IssueService issueService;  
	private final JiraAuthenticationContext jiraAuthenticationContext;

ApplicationUser loggedInUser = jiraAuthenticationContext.getLoggedInUser();
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
issueInputParameters.setSummary(String summary)
					.setDescription(String description)
					.setAssigneeId(String assignee)
					.setReporterId(String reporter)
					.setProjectId(Long projectId)
					.setIssueTypeId(Long issueType id)
IssueService.CreateValidationResult result = issueService.validateCreate(loggedInUser, issueInputParameters);

task,subtask issue 생성하기

@ComponentImport
    private final IssueService issueService;  
	private final JiraAuthenticationContext jiraAuthenticationContext;

ApplicationUser loggedInUser = jiraAuthenticationContext.getLoggedInUser();
IssueService.CreateValidationResult result = issueService.validateCreate(loggedInUser, issueInputParameters);
if(issue = '작업'){
	issueService.create(loggedInUser, result);
}else if(issue = '부작업'){
	MutableIssue issue = issueManager.getIssueByCurrentKey(issueKey);
	IssueService.CreateValidationResult validationResult = issueService.validateSubTaskCreate(loggedInUser, issue.getId(), issueInputParameters);
    issueService.create(loggedInUser, validationResult);
}



Issue Create시 Parent Issue와 Link

Parent issue와 Chlid issue link하기

@ComponentImport
    private final SubTaskManager subTaskManaer

ApplicationUser loggedInUser = jiraAuthenticationContext.getLoggedInUser();
MutableIssue issue = issueManager.getIssueByCurrentKey(issueKey);
MutableIssue parentIssue= issueManager.getIssueByCurrentKey(parentIssueKey);
subTaskManager.createSubTaskIssueLink(parentIssue, chlidIssue , loggedInUser);