Hi,
I'm trying to use Script Post-Function [ScriptRunner] to create the summary of an issue based on the customers' answers in other custom fields.
Jira claims the script has no errors, and that all the issues I submit are passing this script. I am unable to see any logs which show why this is not working, however.
Mind you, I am very new to this scripting-business.
Why is this seemingly running fine - but not updating the "Summary" (nor giving me any log.info I write)?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.worklog.WorklogImpl
import com.atlassian.jira.event.type.EventDispatchOption
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cfKommune = customFieldManager.getCustomFieldObject(12009)
def cfGnr = customFieldManager.getCustomFieldObject(12200)
def cfBnr = customFieldManager.getCustomFieldObject(12201)
def cfAdresse = customFieldManager.getCustomFieldObject(12202)
def cfKortBeskrivelse = customFieldManager.getCustomFieldObject(12209)
if (issue.getIssueType() == "Ny tilknytning/forsterkning") {
String kommune = issue.getCustomFieldValue(cfKommune)
String gnr = issue.getCustomFieldValue(cfGnr)
String bnr = issue.getCustomFieldValue(cfBnr)
String adresse = issue.getCustomFieldValue(cfAdresse)
String kortBeskrivelse = issue.getCustomFieldValue(cfKortBeskrivelse)
def newSummary = kommune + " - " + gnr + "/" + bnr + " - " + adresse + " - " + kortBeskrivelse
issue.setSummary(newSummary)
log.info(newSummary)
}