Skip to main content
Example scripts
arrow icon
To homepage
Jira
Data centre icon
Data Center

Create a Tempo Account

Created 1 year ago, Updated 3 month(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira (8.0 - 8.19)
compatibility bullet
ScriptRunner For Jira (7.10.0)
Language |
groovy
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.tempoplugin.accounts.account.api.Account
import com.tempoplugin.accounts.account.api.AccountBuilderFactory
import com.tempoplugin.accounts.account.api.AccountService
import com.tempoplugin.platform.api.user.UserAuthenticationContext

@WithPlugin('is.origo.jira.tempo-plugin')

@PluginModule
AccountService accountService

@PluginModule
UserAuthenticationContext userAuthenticationContext

@PluginModule
AccountBuilderFactory accountBuilderFactory

// set the current user to be the account manager, and configures this as a global account
def account = accountBuilderFactory
    .createBuilder('ACME', 'Acme Inc.', userAuthenticationContext.authenticatedUser, Account.Status.OPEN).global(true)
    .build()

accountService.createAccount(account)
Having an issue with this script?
Report it here