Examples of CimIssueType


Examples of com.atlassian.jira.rest.client.domain.CimIssueType

        new GetCreateIssueMetadataOptionsBuilder().withProjectKeys("TST").withExpandedIssueTypesFields().build(), pm);

    // select project and issue
    assertEquals(1, Iterables.size(metadataProjects));
    final CimProject project = metadataProjects.iterator().next();
    final CimIssueType issueType = EntityHelper.findEntityByName(project.getIssueTypes(), "Bug");

    // grab the first component
    final Iterable<Object> allowedValuesForComponents = issueType.getField(IssueFieldId.COMPONENTS_FIELD).getAllowedValues();
    assertNotNull(allowedValuesForComponents);
    assertTrue(allowedValuesForComponents.iterator().hasNext());
    final BasicComponent component = (BasicComponent) allowedValuesForComponents.iterator().next();

    // grab the first priority
    final Iterable<Object> allowedValuesForPriority = issueType.getField(IssueFieldId.PRIORITY_FIELD).getAllowedValues();
    assertNotNull(allowedValuesForPriority);
    assertTrue(allowedValuesForPriority.iterator().hasNext());
    final BasicPriority priority = (BasicPriority) allowedValuesForPriority.iterator().next();

    // build issue input
    final String summary = "My new issue!";
    final String description = "Some description";
    final BasicUser assignee = IntegrationTestUtil.USER1;
    final List<String> affectedVersionsNames = Collections.emptyList();
    final DateTime dueDate = new DateTime(new Date().getTime());
    final ArrayList<String> fixVersionsNames = Lists.newArrayList("1.1");

    // prepare IssueInput
    final IssueInputBuilder issueInputBuilder = new IssueInputBuilder(project, issueType, summary)
        .setDescription(description)
        .setAssignee(assignee)
        .setAffectedVersionsNames(affectedVersionsNames)
        .setFixVersionsNames(fixVersionsNames)
        .setComponents(component)
        .setDueDate(dueDate)
        .setPriority(priority);

    // create
    final BasicIssue basicCreatedIssue = issueClient.createIssue(issueInputBuilder.build(), pm);
    assertNotNull(basicCreatedIssue.getKey());

    // get issue and check if everything was set as we expected
    final Issue createdIssue = issueClient.getIssue(basicCreatedIssue.getKey(), pm);
    assertNotNull(createdIssue);

    assertEquals(basicCreatedIssue.getKey(), createdIssue.getKey());
    assertEquals(project.getKey(), createdIssue.getProject().getKey());
    assertEquals(issueType.getId(), createdIssue.getIssueType().getId());
    assertEquals(summary, createdIssue.getSummary());
    assertEquals(description, createdIssue.getDescription());

    final BasicUser actualAssignee = createdIssue.getAssignee();
    assertNotNull(actualAssignee);
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.CimIssueType

    );

    // select project and issue
    assertEquals(1, Iterables.size(metadataProjects));
    final CimProject project = metadataProjects.iterator().next();
    final CimIssueType issueType = EntityHelper.findEntityByName(project.getIssueTypes(), "Bug");

    // build issue input
    final String summary = "My new issue!";

    // create
    final IssueInput issueInput = new IssueInputBuilder(project, issueType, summary).build();
    final BasicIssue basicCreatedIssue = issueClient.createIssue(issueInput, pm);
    assertNotNull(basicCreatedIssue.getKey());

    // get issue and check if everything was set as we expected
    final Issue createdIssue = issueClient.getIssue(basicCreatedIssue.getKey(), pm);
    assertNotNull(createdIssue);

    assertEquals(basicCreatedIssue.getKey(), createdIssue.getKey());
    assertEquals(project.getKey(), createdIssue.getProject().getKey());
    assertEquals(issueType.getId(), createdIssue.getIssueType().getId());
    assertEquals(summary, createdIssue.getSummary());
  }
View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.CimIssueType

    for (CimIssueType t : project.getIssueTypes()) {
      log.log(MessageFormat.format("\t* [{0}] {1}", t.getId(), t.getName()));
    }
    log.log("");

    final CimIssueType issueType = project.getIssueTypes().iterator().next();
    log.log(MessageFormat.format("Selected issue type: [{0}] {1}\n", issueType.getId(), issueType.getName()));

    final IssueInputBuilder builder = new IssueInputBuilder(project.getKey(), issueType.getId());

    // fill fields
    log.log("Filling fields:");
    for (Map.Entry<String, CimFieldInfo> entry : issueType.getFields().entrySet()) {
      final CimFieldInfo fieldInfo = entry.getValue();
      final String fieldCustomType = fieldInfo.getSchema().getCustom();
      final String fieldType = fieldInfo.getSchema().getType();
      final String fieldId = fieldInfo.getId();

View Full Code Here

Examples of com.atlassian.jira.rest.client.domain.CimIssueType

    final JSONObject jsonFieldsMap = json.optJSONObject("fields");
   
    final Map<String, CimFieldInfo> fields = (jsonFieldsMap == null) ?
        Collections.<String, CimFieldInfo>emptyMap() : fieldsParser.parse(jsonFieldsMap);

    return new CimIssueType(issueType.getSelf(), issueType.getId(), issueType.getName(),
        issueType.isSubtask(), issueType.getDescription(), issueType.getIconUri(), fields);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.