Hi,
with this script i copy the value of 2 custom fields into the summary and description field of an issue. When i have this script in a workflow transission as post function it works, not when i implement it as a listener tho:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
long CF_ID_DESCRIPTION_OF_ISSUE = 21036
long CF_ID_SUMMARY_OF_ISSUE = 21035
CustomFieldManager cfManager = ComponentAccessor.getCustomFieldManager()
CustomField descriptionOfIssueCf = cfManager.getCustomFieldObject(CF_ID_DESCRIPTION_OF_ISSUE)
CustomField summaryofIssueCf = cfManager.getCustomFieldObject(CF_ID_SUMMARY_OF_ISSUE)
String descriptionValue = issue.getDescription()
String summaryValue = issue.getSummary()
issue.setCustomFieldValue(descriptionOfIssueCf, descriptionValue)
issue.setCustomFieldValue(summaryofIssueCf, summaryValue)
thx for the help