For support issues please visit

Page tree
Skip to end of metadata
Go to start of metadata


Allow you to execute Groovy scripts directly.

You can access to this screen by clicking Script console in the Profields Administration Menu


Code source

You can select te origin of the script

  • INLINE: You can write the script in the textarea below named "Script code".

  • FILE: You can indicate the path of a script file that was placed in the JIRA server file system.

Execute the script

Only click the button 

If the execution ends successfully, a success message will show with the result of the script.

The code:

def foo = "Foo"
def var = "Var"
return foo + var





If there was an error while executing the script, an error message will show with the trace of the exception.

The code:

def foo = 5
def var = 0
return foo / var



com.deiser.jira.profields.exception.GroovyException: java.lang.ArithmeticException: Division by zero
at com.deiser.jira.profields.action.script.ProfieldsScriptConsole.doExecute(
at webwork.action.ActionSupport.execute(
at com.atlassian.jira.action.JiraActionSupport.execute(
at webwork.interceptor.DefaultInterceptorChain.proceed(
at webwork.interceptor.NestedInterceptorChain.proceed(
at webwork.interceptor.ChainedInterceptor.intercept(


Context Variables

You have several variables available in the script context:


  • logger : org.apache.log4j.Logger
  • configurationService : com.deiser.jira.profields.api.configuration.ConfigurationService
  • fieldService : com.deiser.jira.profields.api.field.FieldService
  • schemeService : com.deiser.jira.profields.api.scheme.SchemeService
  • jiraProjectManager : com.atlassian.jira.project.CachingProjectManager
  • jiraUserManager : com.atlassian.jira.user.util.UserManager
  • jiraAuthenticationContext :
  • jiraApplicationProperties :


StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Profields sort type: " +
stringBuilder.append("<br/>Profields fields configured: " + String.valueOf(fieldService.get().size()))
stringBuilder.append("<br/>JIRA projects count: " + String.valueOf(jiraProjectManager.getProjectObjects().size()))
stringBuilder.append("<br/>JIRA logged in user: " + jiraAuthenticationContext.user.displayName)
stringBuilder.append("<br/>JIRA base url: " + jiraApplicationProperties.getDefaultBackedString(APKeys.JIRA_BASEURL))
return stringBuilder.toString()


Profields sort type: Global
Profields fields configured: 38
JIRA projects count: 10
JIRA logged in user: Tester
JIRA base url:




On this page



  • No labels