Hi guys,
First of all, I have to say I am new in Groovy.
I would like to use Scriptrunner Behaviours to fill in an Insight custom field (named "Persona afectada") with the current user (customer who has an account in JSD), when raising a request in the customer portal.
After browsing a lot, I get this code:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.*
if (getActionName() != "Create Issue") {
return // not the initial action, so don't set default values
}
// set Custom Field Persona afectada
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def person = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Persona afectada")
underlyingIssue.setCustomFieldValue(person,currentUser)
However, I get this error:
[Static type checking] - Cannot find matching method
com.atlassian.jira.issue.Issue#setCustomFieldValue(com.atlassian.jira.issue.field
com.atlassian.jira.user.ApplicationUser). PLease check if the declared type is
correct and if the method exists.
@Line 11, column 1.
I would appreciate any help. Thanks in advance.
Cheers,
Almu