Hello,
I'm trying to write a script in order to set a custom field. I've put in a post function under create transition. Here is the script:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.user.util.UserManager
import com.atlassian.jira.event.type.EventDispatchOption
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def groupManager = ComponentAccessor.getGroupManager()
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def multiGroupCf = customFieldManager.getCustomFieldObjectByName("Demo-Π.Σ.Κ.Ε. Assignable Groups") //multigroup picker custom field
def group1 = groupManager.getGroup("EYKE Group") //jira group
def group2 = groupManager.getGroup("Group_Epilogi_Proistamenon") //jira group
def group3 = groupManager.getGroup("ISO - Security Officers") //jira group
def groupList = [group1, group2, group3]
issue.setCustomFieldValue(multiGroupCf, groupList)
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
The problem is that when I create a new issue I receive the following error:
We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file.
It seems like I can't access the current issue.
Do have any idea about how to solve the problem?
Thanks