Error in my script.

Could you help me to verify if there is any error in my script?

"import java.util.Arrays;

import java.util.Collection;

import java.util.Map;

import webwork.dispatcher.ActionResult;

import com.atlassian.core.ofbiz.CoreFactory;


import com.atlassian.jira.action.ActionNames;

import org.ofbiz.core.entity.GenericValue;

import com.atlassian.core.ofbiz.CoreFactory;


import com.atlassian.jira.ComponentManager;

import com.atlassian.jira.project.ProjectManager;

import com.atlassian.jira.issue.CustomFieldManager;

import com.atlassian.jira.issue.fields.CustomField;

import com.atlassian.jira.issue.MutableIssue;

import com.atlassian.jira.util.ImportUtils;

import com.atlassian.jira.issue.index.IssueIndexManager;

import com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem;

import com.atlassian.jira.issue.*;

import com.atlassian.jira.issue.util.*;

import com.atlassian.jira.config.SubTaskManager;



import com.atlassian.jira.issue.fields.layout.field.*;

import com.atlassian.jira.issue.fields.*;

import com.atlassian.jira.issue.util.DefaultIssueChangeHolder;

import com.opensymphony.workflow.InvalidInputException;

import org.apache.log4j.Category;

import com.opensymphony.user.Group;

import com.atlassian.crowd.embedded.api.Group;

import com.atlassian.jira.component.ComponentAccessor;

def log = null


log = Category.getInstance("log.acotel.groovy");

}catch(Throwable e){

System.out.println("ERRO ao obter a instancia do log4j")




def celular = "customfield_10102"

def permiteComentario = "customfield_10230"

ComponentManager componentManager = ComponentManager.getInstance();

IssueManager issueManager = componentManager.getIssueManager()

SubTaskManager subTaskManager = componentManager.getSubTaskManager();

//JiraAuthenticationContext authenticationContext = componentManager.getJiraAuthenticationContext();

// Adicionado em 20130104 ;

JiraAuthenticationContext authenticationContext = ComponentAccessor.getJiraAuthenticationContext();

// ---

IssueFactory issueFactory = componentManager.getIssueFactory();

ProjectManager projectManager = componentManager.getProjectManager();

CustomFieldManager cfManager = componentManager.getCustomFieldManager()

FieldLayoutManager fieldLayoutManager = componentManager.getFieldLayoutManager()

CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()

CustomField customFieldTarget = customFieldManager.getCustomFieldObject( celular )

CustomField customFieldComentarioTarget = customFieldManager.getCustomFieldObject( permiteComentario )

log.debug("Tarefa pai = " + issue.getKey() + " criada por " + issue.getReporter() )

if( issue.getCustomFieldValue(customFieldTarget) != null && issue.getCustomFieldValue(customFieldTarget).equals("Sim") ){

MutableIssue subTask = issueFactory.getIssue();

MutableIssue mIssue = issue

subTask.setParentObject( issue )

subTask.setReporter( issue.getReporter() )

//Seta o Projeto da Tarefa para para sub-tarefa


//Seta o tipo da tarefa como Sub-Task

subTask.setIssueTypeId( "5" )

//Seta o Titulo da tarefa

subTask.setSummary( "Definir Celular" )

//Seta a descrição da tarefa

subTask.setDescription( "Definir Celular" )

//Seta como Reporte o mesmo da tarefa pai

subTask.setReporter( issue.getReporter())

//Persiste a tarefa com as alterações

GenericValue subTaskSalva = issueManager.createIssue( issue.getReporter(), subTask )

subTaskManager.createSubTaskIssueLink(subTask.getParent(), subTaskSalva, authenticationContext.getUser())

// Seta novo valor no Custom Field Permite Comentario

IssueChangeHolder changeHolder = new DefaultIssueChangeHolder();

List("ACOTEL_users") ), changeHolder)

//Persiste a tarefa com as altera<C3>õe"Sub Task Criada com Chave = " + subTask.getKey() + " da tarefa pai " + issue.getKey())


log.warn("Celular não preenchido sem necessidade de criar sub-tarefa 'Definir Celular' ")


I'm testing the version of Jira 5.2.4. But this error occurring when opening called. When trying to open reports the error in Jira: "Only Manager has permission to create this type of call." However, I belong to the Group Manager and checked now CROWD. But the log reports the following error: "/ secure / QuickCreateIssue.jspa [groovy.canned.utils.ConditionUtils] javax.script.ScriptException: groovy.lang.MissingMethodException: groovy.lang.MissingMethodException: No signature of method: com.atlassian . jira.crowd.embedded.ofbiz Possible solutions: getClass () "

Could you help me?

1 answer

I think the (huge) script you posted is unrelated to your problem. There must be more to that error message as well.

Basically you need to replace osuser with calls to crowd:

And change user.getFullName to user.getDisplayName

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

439 views 8 26
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you