Hi,
I would like to add the issue key at the beginning of the summary and the epic name when an issue is created in the project called SR.
For example : on the create issue page I enter this info
Epic Name : SR Test Epic Name
Summary : SR Test Summary
Lets say that when i click create, the issue key of my issue is SR-101
The "create" post function would change both fields for
Epic Name : SR-101 Test Epic Name
Summary : SR-101 Test Summary
I tried this following script, but the field values doesn't change.
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.issueManager
def srEpicName = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10008")
def srSummary = issue.Summary
def strEpicName = (String) issue.getCustomFieldValue(srEpicName)
def strSummary = (String) srSummary
def strIssueKey = (String) issue.key
String newEpicName = strEpicName.replace("SR",strIssueKey)
String newSummary = strSummary.replace("SR",strIssueKey)
issue.setCustomFieldValue(srEpicName, newEpicName)
issue.setSummary(newSummary)
I don't know what's wrong. Can somebody help me please?
Thank you very much