Tabnine Logo
Project
Code IndexAdd Tabnine to your IDE (free)

How to use
Project
in
com.atlassian.jira.rest.client.api.domain

Best Java code snippets using com.atlassian.jira.rest.client.api.domain.Project (Showing top 14 results out of 315)

origin: org.smartdeveloperhub.harvesters.it.backend/it-backend-core

private Set<String> getVersionsByIds(com.atlassian.jira.rest.client.api.domain.Project jiraProject) {
  Set<String> versionsIds = new HashSet<>();
  for (com.atlassian.jira.rest.client.api.domain.Version version : jiraProject.getVersions()) {
    versionsIds.add(String.valueOf(version.getId()));
  }
  return versionsIds;
}
origin: org.smartdeveloperhub.harvesters.it.backend/it-backend-core

  private Set<String> getComponentsByIds(com.atlassian.jira.rest.client.api.domain.Project jiraProject) {

    Set<String> componentsIds = new HashSet<>();

    for (com.atlassian.jira.rest.client.api.domain.BasicComponent component : jiraProject.getComponents()) {

      componentsIds.add(String.valueOf(component.getId()));
    }
    return componentsIds;
  }
}
origin: org.smartdeveloperhub.harvesters.it.backend/it-backend-core

                        jiraProject.getKey(),
                        lastUpdate);
              projects.get(jiraProject.getKey());
  event.setNewProjects(Lists.newArrayList(jiraProject.getKey()));
  sendNotification(event);
projects.put(jiraProject.getKey(), project);
Set<Component> components = getAllComponents(jiraProject.getKey(), jiraProject.getComponents());
Map<String, Component> oldComponentsMap = storage.loadComponents(jiraProject.getKey());
event.setProject(jiraProject.getKey());
for (String id : newComponents) {
  event.append(Modification.create().component(id));
storage.storeComponents(jiraProject.getKey(), components);
Set<org.smartdeveloperhub.harvesters.it.backend.Version> versions = getAllVersions(jiraProject.getKey(), jiraProject.getVersions());
Map<String, org.smartdeveloperhub.harvesters.it.backend.Version> oldVersionsMap = storage.loadVersions(jiraProject.getKey());
storage.storeVersions(jiraProject.getKey(), versions);
storage.storeIssues(jiraProject.getKey(), issues.values());
origin: com.atlassian.jira/jira-rest-java-client-core

@Override
public Project parse(JSONObject json) throws JSONException {
  URI self = JsonParseUtil.getSelfUri(json);
  final Iterable<String> expandos = parseExpandos(json);
  final BasicUser lead = JsonParseUtil.parseBasicUser(json.getJSONObject("lead"));
  final String key = json.getString("key");
  final Long id = JsonParseUtil.getOptionalLong(json, "id");
  final String name = JsonParseUtil.getOptionalString(json, "name");
  final String urlStr = JsonParseUtil.getOptionalString(json, "url");
  URI uri;
  try {
    uri = urlStr == null || "".equals(urlStr) ? null : new URI(urlStr);
  } catch (URISyntaxException e) {
    uri = null;
  }
  String description = JsonParseUtil.getOptionalString(json, "description");
  if ("".equals(description)) {
    description = null;
  }
  final Collection<Version> versions = JsonParseUtil.parseJsonArray(json.getJSONArray("versions"), versionJsonParser);
  final Collection<BasicComponent> components = JsonParseUtil.parseJsonArray(json
      .getJSONArray("components"), componentJsonParser);
  final JSONArray issueTypesArray = json.optJSONArray("issueTypes");
  final OptionalIterable<IssueType> issueTypes = JsonParseUtil.parseOptionalJsonArray(issueTypesArray, issueTypeJsonParser);
  final Collection<BasicProjectRole> projectRoles = basicProjectRoleJsonParser.parse(JsonParseUtil
      .getOptionalJsonObject(json, "roles"));
  return new Project(expandos, self, key, id, name, description, lead, uri, versions, components, issueTypes, projectRoles);
}
origin: org.smartdeveloperhub.harvesters.it.backend/it-backend-core

/**
 * Method for building {@link Project} from Jira projects.
 * @param jiraProject for retrieve Project information.
 * @param topIssues of the project.
 * @param childIssues of the project.
 * @return {@link Project}
 */
public Project createProject(com.atlassian.jira.rest.client.api.domain.Project jiraProject,
                Set<Issue> topIssues, Set<Issue> childIssues) {
  Project project = new Project();
  project.setId(jiraProject.getKey());
  project.setName(jiraProject.getName());
  project.setVersions(getVersionsByIds(jiraProject));
  project.setComponents(getComponentsByIds(jiraProject));
  Set<String> topIds = getIssuesByIds(topIssues);
  Set<String> issuesIds = getIssuesByIds(childIssues);
  issuesIds.addAll(topIds);
  project.setTopIssues(topIds);
  project.setIssues(issuesIds);
  return project;
}
origin: OpenNMS/opennms

  @Override
  protected void doExecute(JiraRestClient jiraRestClient) throws Exception {
    Iterable<BasicProject> basicProjects = jiraRestClient.getProjectClient().getAllProjects().get();
    if (!basicProjects.iterator().hasNext()) {
      System.out.println("No projects available or visible to the current user");
    } else {
      System.out.println(String.format(DEFAULT_ROW_FORMAT, "Key", "Name", "Description"));
      for (BasicProject eachProject : basicProjects) {
        String description = jiraRestClient.getProjectClient().getProject(eachProject.getKey()).get().getDescription();
        System.out.println(
            String.format(DEFAULT_ROW_FORMAT, eachProject.getKey(), eachProject.getName(), description == null ? "" : removeNewLines(description)));
      }
    }
  }
}
origin: org.openengsb.wrapped/jira-rest-java-client-core

@Override
public Project parse(JSONObject json) throws JSONException {
  URI self = JsonParseUtil.getSelfUri(json);
  final Iterable<String> expandos = parseExpandos(json);
  final BasicUser lead = JsonParseUtil.parseBasicUser(json.getJSONObject("lead"));
  final String key = json.getString("key");
  final Long id = JsonParseUtil.getOptionalLong(json, "id");
  final String name = JsonParseUtil.getOptionalString(json, "name");
  final String urlStr = JsonParseUtil.getOptionalString(json, "url");
  URI uri;
  try {
    uri = urlStr == null || "".equals(urlStr) ? null : new URI(urlStr);
  } catch (URISyntaxException e) {
    uri = null;
  }
  String description = JsonParseUtil.getOptionalString(json, "description");
  if ("".equals(description)) {
    description = null;
  }
  final Collection<Version> versions = JsonParseUtil.parseJsonArray(json.getJSONArray("versions"), versionJsonParser);
  final Collection<BasicComponent> components = JsonParseUtil.parseJsonArray(json
      .getJSONArray("components"), componentJsonParser);
  final JSONArray issueTypesArray = json.optJSONArray("issueTypes");
  final OptionalIterable<IssueType> issueTypes = JsonParseUtil.parseOptionalJsonArray(issueTypesArray, issueTypeJsonParser);
  final Collection<BasicProjectRole> projectRoles = basicProjectRoleJsonParser.parse(JsonParseUtil
      .getOptionalJsonObject(json, "roles"));
  return new Project(expandos, self, key, id, name, description, lead, uri, versions, components, issueTypes, projectRoles);
}
origin: org.opennms.features/jira-troubleticketer

  @Override
  protected void doExecute(JiraRestClient jiraRestClient) throws Exception {
    Iterable<BasicProject> basicProjects = jiraRestClient.getProjectClient().getAllProjects().get();
    if (!basicProjects.iterator().hasNext()) {
      System.out.println("No projects available or visible to the current user");
    } else {
      System.out.println(String.format(DEFAULT_ROW_FORMAT, "Key", "Name", "Description"));
      for (BasicProject eachProject : basicProjects) {
        String description = jiraRestClient.getProjectClient().getProject(eachProject.getKey()).get().getDescription();
        System.out.println(
            String.format(DEFAULT_ROW_FORMAT, eachProject.getKey(), eachProject.getName(), description == null ? "" : removeNewLines(description)));
      }
    }
  }
}
origin: org.jboss.set/jboss-aphrodite-jira

  @Override
  public boolean isCPReleased(String cpVersion) {
    // For Jira, only accept GA version format x.y.z.GA, e.g. 7.1.2.GA
    // ignore CR version like 7.0.7.CR3
    Matcher matcher = JIRAFIXVERSION.matcher(cpVersion);
    if (!matcher.matches()) {
      return false;
    }
    Promise<Project> promise = restClient.getProjectClient().getProject("JBEAP");
    Project project = promise.claim();

    Optional<Version> version = StreamSupport.stream(project.getVersions().spliterator(), false)
                         .filter(v -> v.getName().equals(cpVersion))
                         .findAny();
    if (version.isPresent()) {
      return version.get().isReleased();
    }

    return false;
  }
}
origin: OpenNMS/opennms

  @Override
  protected void doExecute(JiraRestClient jiraRestClient) throws Exception {
    final String theProjectKey = Strings.isNullOrEmpty(projectKey) ? getConfig().getProjectKey() : projectKey;
    final Iterable<BasicComponent> components = jiraRestClient.getProjectClient().getProject(theProjectKey).get().getComponents();
    if (!components.iterator().hasNext()) {
      System.out.println("No components found for project '" + theProjectKey + "'");
      return;
    }
    System.out.println(String.format(DEFAULT_ROW_FORMAT, "Id", "Name", "Description"));
    for (BasicComponent eachComponent : components) {
      System.out.println(
          String.format(DEFAULT_ROW_FORMAT,
              eachComponent.getId(),
              eachComponent.getName(),
              eachComponent.getDescription() == null ? "" : removeNewLines(eachComponent.getDescription())));
    }
  }
}
origin: OpenNMS/opennms

  @Override
  protected void doExecute(JiraRestClient jiraRestClient) throws Exception {
    final String theProjectKey = Strings.isNullOrEmpty(projectKey) ? getConfig().getProjectKey() : projectKey;
    final Iterable<Version> versions = jiraRestClient.getProjectClient().getProject(theProjectKey).get().getVersions();
    if (!versions.iterator().hasNext()) {
      System.out.println("No versions found for project '" + theProjectKey + "'.");
      return;
    }
    System.out.println(String.format(DEFAULT_ROW_FORMAT, "Id", "Name", "Description"));
    for (Version eachVersion : versions) {
      System.out.println(
          String.format(
              DEFAULT_ROW_FORMAT,
              eachVersion.getId(),
              eachVersion.getName(),
              eachVersion.getDescription() == null ? "" : removeNewLines(eachVersion.getDescription())));
    }
  }
}
origin: org.opennms.features/jira-troubleticketer

  @Override
  protected void doExecute(JiraRestClient jiraRestClient) throws Exception {
    final String theProjectKey = Strings.isNullOrEmpty(projectKey) ? getConfig().getProjectKey() : projectKey;
    final Iterable<BasicComponent> components = jiraRestClient.getProjectClient().getProject(theProjectKey).get().getComponents();
    if (!components.iterator().hasNext()) {
      System.out.println("No components found for project '" + theProjectKey + "'");
      return;
    }
    System.out.println(String.format(DEFAULT_ROW_FORMAT, "Id", "Name", "Description"));
    for (BasicComponent eachComponent : components) {
      System.out.println(
          String.format(DEFAULT_ROW_FORMAT,
              eachComponent.getId(),
              eachComponent.getName(),
              eachComponent.getDescription() == null ? "" : removeNewLines(eachComponent.getDescription())));
    }
  }
}
origin: org.opennms.features/jira-troubleticketer

  @Override
  protected void doExecute(JiraRestClient jiraRestClient) throws Exception {
    final String theProjectKey = Strings.isNullOrEmpty(projectKey) ? getConfig().getProjectKey() : projectKey;
    final Iterable<Version> versions = jiraRestClient.getProjectClient().getProject(theProjectKey).get().getVersions();
    if (!versions.iterator().hasNext()) {
      System.out.println("No versions found for project '" + theProjectKey + "'.");
      return;
    }
    System.out.println(String.format(DEFAULT_ROW_FORMAT, "Id", "Name", "Description"));
    for (Version eachVersion : versions) {
      System.out.println(
          String.format(
              DEFAULT_ROW_FORMAT,
              eachVersion.getId(),
              eachVersion.getName(),
              eachVersion.getDescription() == null ? "" : removeNewLines(eachVersion.getDescription())));
    }
  }
}
origin: org.jboss.set/jboss-aphrodite-jira

IssueInput issueToFluentUpdate(Issue issue, com.atlassian.jira.rest.client.api.domain.Issue jiraIssue, Project project) throws NotFoundException {
  checkUnsupportedUpdateFields(issue);
  IssueInputBuilder inputBuilder = new IssueInputBuilder(jiraIssue.getProject().getKey(), jiraIssue.getIssueType().getId());
  issue.getSummary().ifPresent(inputBuilder::setSummary);
  inputBuilder.setFieldInput(new FieldInput(IssueFieldId.COMPONENTS_FIELD,
      issue.getComponents().stream().map(e -> ComplexIssueInputFieldValue.with("name", e)).collect(Collectors.toList()))
  );
  issue.getDescription().ifPresent(inputBuilder::setDescription);
  issue.getAssignee().ifPresent(assignee -> inputBuilder.setFieldInput(
      new FieldInput(IssueFieldId.ASSIGNEE_FIELD, ComplexIssueInputFieldValue.with("name",
          assignee.getName().orElseThrow(this::nullUsername)))));
  // this is ok but does nothing if there is no permissions.
  issue.getStage().getStateMap().entrySet()
    .stream().filter(entry -> entry.getValue() != FlagStatus.NO_SET)
    .forEach(entry -> inputBuilder.setFieldInput(new FieldInput(JSON_CUSTOM_FIELD + FLAG_MAP.get(entry.getKey()), entry.getValue().getSymbol())));
  Map<String, Version> versionsMap = StreamSupport.stream(project.getVersions().spliterator(), false)
      .collect(Collectors.toMap(Version::getName, Function.identity()));
  updateFixVersions(issue, versionsMap, inputBuilder);
  updateStreamStatus(issue, jiraIssue, versionsMap, inputBuilder);
  return inputBuilder.build();
}
com.atlassian.jira.rest.client.api.domainProject

Javadoc

Complete information about single JIRA project. Many REST resources instead include just @{}BasicProject

Most used methods

  • getVersions
  • <init>
  • getComponents
  • getDescription
  • getKey
  • getName

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now