Example scripts
To homepage
Jira

Create a Tempo Account
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira (8.0 - 8.19)

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