I have set up project that only has one issue type. This is a custom issue type that collects only specific information. The Summary field does not make any sense in this context. I understand that the Summary field is a mandatory field and can't be hidden. So, I have pre-poluated the field with the words 'Will be populated by post function' and moved it to the bottom of the create screen. Only the required custom fields are displayed on the create screen - all the other normal JIRA fields have been hidden.
In the workflow, I have a post function under the create transition, to update the Summary field. This works well for static content using a Custom script post-function with just the following:
issue.summary = "static content";
However, when I try to read the value from a custom field and use that to write to the Summary field, it doesn't work. I've tried the following variations, and both before and after 'Creates the issue originally. ' with no success.
def newSummary = issue.getCustomFieldValue(11310)?.getValue();
issue.summary = newSummary;
def newSummary = issue.getCustomFieldValue(11310);
issue.summary = newSummary;
What am I missing?