I got stuck with the above error:
I also tried def issue = event.issue and no luck. This is on jira version 7.13. Please assist
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.customfields.option.LazyLoadedOption
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.MutableIssue
Issue issue = event.issue //Error is on this line
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField2 = customFieldManager.getCustomFieldObjectByName("System")
LazyLoadedOption systemOption = (LazyLoadedOption) issue.getCustomFieldValue(customField2)
def changeHolder = new DefaultIssueChangeHolder();
def customField4 = customFieldManager.getCustomFieldObjects(issue).find {it.name == "Aquarius Category"}
if (systemOption?.getValue() == "CMS2") {
customField4.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(customField4), ""),changeHolder)
}
Assuming you are creating an event listener via Scriptrunner you should notice which Jira event you are listening for your script.
It sounds to me that your event listener is listening to an event that is not related to a Jira issue.
Please read more about Scriptrunner listeners
Regards
Lasse Langhorn
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.