What I have determined is a way to pull the result of a custom field from a already created ticket.
def issueKey = 'TM-XXX'
def result = get('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.asObject(Map)
if (result.status == 200){
return result.body.fields.customfield_10511
} else {
return "Failed to find issue: Status: ${result.status} ${result.body}"
}
Now what I am trying to achieve is create a sub-task using a workflow post function and pull in this custom field from the parent issue and set it as part of the summary of the sub-task that is being created.
For example:
I create an issue with a custom field of server name with a value of XXXDC1.
I want to create the subtask.fields.summary that would be XXXDC1 | "and some other text."