Package com.atlassian.jira.rest.client.api.domain.input

Examples of com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder


    final ArrayList<String> fixVersionsNames = Lists.newArrayList("1.1");

    // prepare IssueInput
    final String multiUserCustomFieldId = "customfield_10031";
    final ImmutableList<BasicUser> multiUserCustomFieldValues = ImmutableList.of(IntegrationTestUtil.USER1, IntegrationTestUtil.USER2);
    final IssueInputBuilder issueInputBuilder = new IssueInputBuilder(project, issueType, summary)
        .setDescription(description)
        .setAssignee(assignee)
        .setAffectedVersionsNames(affectedVersionsNames)
        .setFixVersionsNames(fixVersionsNames)
        .setComponents(component)
        .setDueDate(dueDate)
        .setPriority(priority)
        .setFieldValue(multiUserCustomFieldId, multiUserCustomFieldValues);

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

    // get issue and check if everything was set as we expected
    final Issue createdIssue = issueClient.getIssue(basicCreatedIssue.getKey()).claim();
    assertNotNull(createdIssue);
View Full Code Here


    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)
        .setFieldValue("parent", ComplexIssueInputFieldValue.with("key", "TST-1"));

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

    // get issue and check if everything was set as we expected
    final Issue createdIssue = issueClient.getIssue(basicCreatedIssue.getKey()).claim();
    assertNotNull(createdIssue);
View Full Code Here

    // prepare IssueInput
    final List<IssueInput> issuesToCreate = Lists.newArrayList();
    for (final String summary : summaries) {

      final IssueInputBuilder issueInputBuilder =
          new IssueInputBuilder(project, issueType, summary)
              .setDescription(description)
              .setAssignee(assignee)
              .setAffectedVersionsNames(affectedVersionsNames)
              .setFixVersionsNames(fixVersionsNames)
              .setComponents(component)
              .setDueDate(dueDate)
              .setPriority(priority)
              .setFieldValue("parent", ComplexIssueInputFieldValue.with("key", "TST-1"));

      issuesToCreate.add(issueInputBuilder.build());
    }
    assertEquals(summaries.size(), issuesToCreate.size());

    // create
    final BulkOperationResult<BasicIssue> createdIssues = issueClient.createIssues(issuesToCreate).claim();
View Full Code Here

      //last issue to create will have a non existing project - to simulate creation error
      if (summariesWithError.contains(summary)) {
        currentProjectKey = "FAKE_KEY";
      }

      final IssueInputBuilder issueInputBuilder =
          new IssueInputBuilder(currentProjectKey, issueType.getId(), summary)
              .setDescription(description)
              .setAssignee(assignee)
              .setAffectedVersionsNames(affectedVersionsNames)
              .setFixVersionsNames(fixVersionsNames)
              .setComponents(component)
              .setDueDate(dueDate)
              .setPriority(priority)
              .setFieldValue("parent", ComplexIssueInputFieldValue.with("key", "TST-1"));

      issuesToCreate.add(issueInputBuilder.build());
    }
    assertEquals(summaries.size(), issuesToCreate.size());

    // create
    final BulkOperationResult<BasicIssue> createdIssues = issueClient.createIssues(issuesToCreate).claim();
View Full Code Here

      //last issue to create will have a non existing project - to simulate creation error
      if (summariesWithError.contains(summary)) {
        currentProjectKey = "FAKE_KEY";
      }

      final IssueInputBuilder issueInputBuilder =
          new IssueInputBuilder(currentProjectKey, issueType.getId(), summary)
              .setDescription(description)
              .setAssignee(assignee)
              .setAffectedVersionsNames(affectedVersionsNames)
              .setFixVersionsNames(fixVersionsNames)
              .setComponents(component)
              .setDueDate(dueDate)
              .setPriority(priority)
              .setFieldValue("parent", ComplexIssueInputFieldValue.with("key", "TST-1"));

      issuesToCreate.add(issueInputBuilder.build());
    }
    assertEquals(summaries.size(), issuesToCreate.size());

    // create
    try {
View Full Code Here

    // 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).claim();
    assertNotNull(basicCreatedIssue.getKey());

    // get issue and check if everything was set as we expected
    final Issue createdIssue = issueClient.getIssue(basicCreatedIssue.getKey()).claim();
View Full Code Here

    final IssueRestClient issueClient = client.getIssueClient();

    thrown.expect(RestClientException.class);
    thrown.expectMessage("You must specify a summary of the issue.");

    final IssueInput issueInput = new IssueInputBuilder("TST", 1L).build();
    issueClient.createIssue(issueInput).claim();
  }
View Full Code Here

    final IssueRestClient issueClient = client.getIssueClient();

    thrown.expect(RestClientException.class);
    thrown.expectMessage("project is required");

    final IssueInput issueInput = new IssueInputBuilder("BAD", 1L, "Should fail").build();
    issueClient.createIssue(issueInput).claim();
  }
View Full Code Here

    final IssueRestClient issueClient = client.getIssueClient();

    thrown.expect(RestClientException.class);
    thrown.expectMessage("valid issue type is required");

    final IssueInput issueInput = new IssueInputBuilder("TST", 666L, "Should fail").build();
    issueClient.createIssue(issueInput).claim();
  }
View Full Code Here

    thrown.expect(RestClientException.class);
    thrown.expectMessage(String
        .format("Field '%s' cannot be set. It is not on the appropriate screen, or unknown.", fieldId));

    final IssueInput issueInput = new IssueInputBuilder("TST", 1L, "Should fail")
        .setFieldValue(fieldId, "test")
        .build();
    issueClient.createIssue(issueInput).claim();
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder

Copyright © 2018 www.massapicom. 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.