Behaviour. Automatic completion of fields when creating a request

Gregory May 26, 2022

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.UpdateIssueRequest

def environmentFI = getFieldById("customfield_11111") 

def cfServic = getFieldById("customfield_222222") 
String cfAreaValue = cfServic.getValue()

def cfServi = getFieldById("customfield_33333") 
String cfServiceValue = cfServi.getValue()

def cfServ = getFieldById("customfield_44444") 
String cfDirectionValue = cfServ.getValue()

def getInsightObject(String key) {
Class objectFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().loadClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade")
def objectFacade = ComponentAccessor.getOSGiComponentInstanceOfType(objectFacadeClass)
return objectFacade.loadObjectBean(key).id.toString()
}

if (cfServic.getValue().equals("EI-313333") && cfServi.getValue().equals("EI-323333") && cfServ.getValue().equals("EI-333333")){
//environmentFI.setFormValue(getInsightObject("EI-343333"))
environmentFI.setFormValue("EI-353333")
}

2 answers

0 votes
Gregory May 27, 2022

Problem

Script146.groovy:21 [Static type checking] - Cannot find matching method java.lang.Object#loadObjectBean(java.lang.String). Please check if the declared type is correct and if the method exists. @ line 21, column 12.

0 votes
Gregory May 26, 2022

Unable to create automation. So that when creating a request, with certain selected fields, the remaining fields are filled

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events