Interface AccountService


public interface AccountService
Requires one of WorklogPRO administrator, Jira Administrator or Jira System Administrator performance. Allows user to configure Accounts.
  • Method Details

    • getAccountHierarchy

      java.util.Set<AccountImp> getAccountHierarchy​(boolean onlyOpenAccounts)
      Returns hierarchical account structure.
    • createAccount

      AccountImp createAccount​(AccountImp accountImp)
      Creates account specified.
      Parameters:
      accountImp - account creation params
      Returns:
      returns account with new account id.
    • updateAccount

      AccountImp updateAccount​(AccountImp accountImp)
      Updates account. Account need to be exist.
      Parameters:
      accountImp - account parameters
      Returns:
      returns updated account.
    • deleteAccount

      void deleteAccount​(int accountId)
      Deletes specified account.
      Parameters:
      accountId - id of the account to be deleted.
    • hasAccountConfigurationPermission

      boolean hasAccountConfigurationPermission​(com.atlassian.jira.user.ApplicationUser userParam)
      Checks whether given user has permission to modify accounts.
      Parameters:
      userParam - user to check. Can be null and if null uses currently logged in user.
      Returns:
      true if user has permission.
    • moveAccount

      AccountImp moveAccount​(int accountId, int parentAccountId)
      Moves account to new parent. Pass -1 to move to the root.
      Parameters:
      accountId - id of the account to be moved
      parentAccountId - new parent of account
      Returns:
      updated account
    • getAccountImp

      java.util.Optional<AccountImp> getAccountImp​(java.lang.Integer accountId)
      Returns account with given id.
      Parameters:
      accountId - account id.
      Returns:
      account with given id.
    • addAccountListener

      void addAccountListener​(AccountListener accountListener)
      Adds a new account listener.
      Parameters:
      accountListener - account listener.
    • getAccountByName

      java.util.Optional<AccountImp> getAccountByName​(java.lang.String name)
      Fonds all accounts with given name.
      Parameters:
      name - name of account
      Returns:
      accounts or empty list.
    • getAccountById

      java.util.Optional<AccountImp> getAccountById​(int id)
    • getAccounts

      java.util.Set<AccountImp> getAccounts​(AccountStatus status)
      Returns accounts with requested status.
      Parameters:
      status - status filter. if null all accounts are returned.
      Returns:
      all accounts
    • getAccountCustomField

      java.util.Optional<com.atlassian.jira.issue.fields.CustomField> getAccountCustomField()
      Returns reference to account custom field.
      Returns:
      account custom field.
    • getSelectedAccountForIssue

      java.util.Optional<AccountImp> getSelectedAccountForIssue​(com.atlassian.jira.issue.Issue issue)
      Returns currently selected account for issue.
      Parameters:
      issue - issue, can't be null
      Returns:
      selected account if exist.
    • getAccountsMap

      java.util.Map<java.lang.Long,​AccountImp> getAccountsMap​(java.lang.Long[] workLogIdList)
      Returns a map from worklog id to account.
      Parameters:
      workLogIdList - list of worklog ids.
      Returns:
      worklog id to account map.
    • getGlobalAccounts

      java.util.Set<AccountImp> getGlobalAccounts​(AccountStatus status)
    • getApplicableAccountsForIssue

      java.util.Set<AccountImp> getApplicableAccountsForIssue​(AccountStatus status, com.atlassian.jira.issue.Issue issue)
      Returns accounts for the issue. Different than getApplicableAccountsForProject this method also returns existing account on the issue even if account is no longer applicable for the project of the issue.
      Parameters:
      status - account status requested. pass null for all statuses.
      issue - issue can't be null
      Returns:
      applicable accounts
    • getApplicableAccountsForProject

      java.util.Set<AccountImp> getApplicableAccountsForProject​(AccountStatus status, java.lang.Long projectId)
      Returns accounts for the project with given status.
      Parameters:
      status - account status requested. pass null for all statuses.
      projectId - project id.
      Returns:
      accounts applicable for the project with given status.
    • removeAccountFromWorklog

      void removeAccountFromWorklog​(java.lang.Long worklogId)
      Removes account association from worklog
      Parameters:
      worklogId - worklog id
    • addAccountToWorklog

      AccountWorklog addAccountToWorklog​(java.lang.Long worklogId, int accountId, java.util.Date workStart)
      Associates a worklog with an account.
      Parameters:
      worklogId - worklog id
      accountId - account id
      workStart - the same with Worklog.workStart
      Returns:
      created association
    • getAccountForWorklog

      java.util.Optional<AccountImp> getAccountForWorklog​(java.lang.Long worklogId)
      returns account associated with worklog
      Parameters:
      worklogId - id of worklog
      Returns:
      account for worklog
    • getWorklogsForAccountsBetweenDates

      java.util.Set<java.lang.Long> getWorklogsForAccountsBetweenDates​(java.lang.Integer[] accountIds, java.time.ZonedDateTime startDate, java.time.ZonedDateTime endDate)
    • getAccountIdsInHierarchies

      @Nonnull java.lang.Integer[] getAccountIdsInHierarchies​(java.lang.Integer[] accountIds)
    • getAccountsInHierarchy

      java.util.Set<AccountImp> getAccountsInHierarchy​(int accountId)