本文整理汇总了Java中com.atlassian.jira.rest.client.domain.input.IssueInputBuilder类的典型用法代码示例。如果您正苦于以下问题:Java IssueInputBuilder类的具体用法?Java IssueInputBuilder怎么用?Java IssueInputBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IssueInputBuilder类属于com.atlassian.jira.rest.client.domain.input包,在下文中一共展示了IssueInputBuilder类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import com.atlassian.jira.rest.client.domain.input.IssueInputBuilder; //导入依赖的package包/类
@Override
public void process(Exchange exchange) throws Exception {
String projectKey = exchange.getIn().getHeader("ProjectKey", String.class);
Long issueTypeId = exchange.getIn().getHeader("IssueTypeId", Long.class);
String issueSummary = exchange.getIn().getHeader("IssueSummary", String.class);
IssueInputBuilder issueBuilder = new IssueInputBuilder(projectKey, issueTypeId);
issueBuilder.setDescription(exchange.getIn().getBody(String.class));
issueBuilder.setSummary(issueSummary);
BasicIssue issue = client().getIssueClient().createIssue(issueBuilder.build(), null);
// support InOut
if (exchange.getPattern().isOutCapable()) {
// copy the header of in message to the out message
exchange.getOut().copyFrom(exchange.getIn());
exchange.getOut().setBody(issue);
} else {
exchange.getIn().setBody(issue);
}
}
示例2: updateIssue
import com.atlassian.jira.rest.client.domain.input.IssueInputBuilder; //导入依赖的package包/类
public Issue updateIssue(GenericArtifact ga, String projectKey,
String issueTypeString, JIRAConnection connection) {
JiraRestClient restClient = connection.getJiraRestClient();
IssueRestClient issueClient = restClient.getIssueClient();
DateTime updatedDate = null;
String issueId = ga.getTargetArtifactId();
Issue issue = issueClient.getIssue(issueId, pm);
Long issueRevision = issue.getUpdateDate().getMillis();
if (!AbstractWriter.handleConflicts(issueRevision, ga)) {
return null;
}
final IssueInputBuilder issueInputBuilder = getIssueInputBuilder(ga,
projectKey, issueTypeString, issueClient);
issueClient
.updateIssue(issue.getKey(), issueInputBuilder.build(), null);
issue = issueClient.getIssue(issueId, pm);
issue = addIssueComment(ga, issueClient, issue.getKey(), issue);
updatedDate = issue.getUpdateDate();
//FIXME calculate update date based on MAX(latest ccf entry from change log, latest ccf entry from comments,latest know update date)
ga.setTargetArtifactVersion(String.valueOf(updatedDate.getMillis()));
try {
ga.setTargetArtifactLastModifiedDate(GenericArtifactHelper.df
.format(updatedDate.toDate()));
} catch (NullPointerException e) {
String message = "Null pointer getting the workItem changedDate in workItem ("
+ issueId + ")";
throw new CCFRuntimeException(message);
}
return issue;
}
示例3: getIssueInputBuilder
import com.atlassian.jira.rest.client.domain.input.IssueInputBuilder; //导入依赖的package包/类
/**
* @param ga
* @param projectKey
* @param issueTypeString
* @param issueClient
* @return
*/
private IssueInputBuilder getIssueInputBuilder(GenericArtifact ga,
String projectKey, String issueTypeString,
IssueRestClient issueClient) {
final Iterable<CimProject> metadataProjects = issueClient
.getCreateIssueMetadata(
new GetCreateIssueMetadataOptionsBuilder()
.withProjectKeys(projectKey)
.withIssueTypeNames(issueTypeString)
.withExpandedIssueTypesFields().build(), pm);
final CimProject project = metadataProjects.iterator().next();
final CimIssueType createIssueType = EntityHelper.findEntityByName(
project.getIssueTypes(), issueTypeString);
final IssueInputBuilder issueInputBuilder = new IssueInputBuilder(
projectKey, createIssueType.getId());
Map<String, CimFieldInfo> fieldMap = createIssueType.getFields();
Iterator<Entry<String, CimFieldInfo>> fieldsit = fieldMap.entrySet()
.iterator();
while (fieldsit.hasNext()) {
Entry<String, CimFieldInfo> field = fieldsit.next();
String fieldId = field.getValue().getId();
List<GenericArtifactField> gaFields = ga
.getAllGenericArtifactFieldsWithSameFieldName(fieldId);
if (gaFields != null && gaFields.get(0).getFieldValueHasChanged()) {
issueInputBuilder.setFieldValue(fieldId, gaFields.get(0)
.getFieldValue());
}
}
return issueInputBuilder;
}
示例4: createIssue
import com.atlassian.jira.rest.client.domain.input.IssueInputBuilder; //导入依赖的package包/类
public BasicIssue createIssue(GenericArtifact ga, String projectKey,
String issueTypeString, JIRAConnection connection) {
//FIXME implement retry logic for mid-air conflicts
//FIXME Adding comments
//FIXME Setting all fields
//FIXME Creating Parent-Child dependencies
//FIXME to find out correct version number
//FIXME html to plain text conversion
//FIXME get issue type IDs instead of name
DateTime createdDate = null;
JiraRestClient restClient = connection.getJiraRestClient();
IssueRestClient issueClient = restClient.getIssueClient();
final IssueInputBuilder issueInputBuilder = getIssueInputBuilder(ga,
projectKey, issueTypeString, issueClient);
final BasicIssue basicCreatedIssue = issueClient.createIssue(
issueInputBuilder.build(), pm);
Issue issue = issueClient.getIssue(basicCreatedIssue.getKey(), pm);
Iterable<com.atlassian.jira.rest.client.domain.Field> fields = issue
.getFields();
issue = addIssueComment(ga, issueClient, basicCreatedIssue.getKey(),
issue);
if (issue.getComments() != null) {
createdDate = getUpdatedDate(connection, issue);
}
//TODO Code will be used on Updateissue()
/*
* if (issue.getChangelog() != null) { Iterator<ChangelogGroup> it =
* issue.getChangelog().iterator(); while (it.hasNext()) { // FIXME Find
* out the change log items order ChangelogGroup changeLogGroup =
* it.next(); BasicUser createdUser = changeLogGroup.getAuthor(); if
* (connection.getUsername().equalsIgnoreCase( createdUser.getName())) {
* createdDate = changeLogGroup.getCreated(); break; } } }
*/
createdDate = issue.getCreationDate();
if (createdDate == null) {
throw new CCFRuntimeException(
"Could not determine creation date for newly created issue "
+ issue.getKey());
}
ga.setTargetArtifactVersion(String.valueOf(createdDate.getMillis()));
try {
ga.setTargetArtifactLastModifiedDate(GenericArtifactHelper.df
.format(createdDate.toDate()));
} catch (NullPointerException e) {
String message = "Null pointer setting the new workItem changedDate";
throw new CCFRuntimeException(message);
}
ga.setTargetArtifactId(String.valueOf(basicCreatedIssue.getId()));
return basicCreatedIssue;
}