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.core.util.map.EasyMap;

import com.atlassian.jira.action.ActionNames;

import org.ofbiz.core.entity.GenericValue;

import com.atlassian.core.ofbiz.CoreFactory;

import com.atlassian.core.util.map.EasyMap;

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.security.JiraAuthenticationContext;

import com.atlassian.jira.security.roles.*;

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

try{

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

}catch(Throwable e){

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

e.printStackTrace();

return

}

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

subTask.setProject(projectManager.getProject(issue.getProjectObject().getId()))

//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

subTask.store()

log.info("Sub Task Criada com Chave = " + subTask.getKey() + " da tarefa pai " + issue.getKey())

}else{

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

0 vote

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: https://developer.atlassian.com/display/JIRADEV/How+to+migrate+a+plugin+from+JIRA+4.x+to+JIRA+5.0

And change user.getFullName to user.getDisplayName

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

74 views 0 5
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