Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I reference a customfield in the summary of Scriptrunner's "Create a sub-task" post function?

Charlie Misonne
Community Champion
February 19, 2018

I am creating a workflow in which a subtask is created automatically in a transition using the Create a sub-task post function from Scriptrunner.

I want to use the value of a (text) custom field as the summary of the subtask.

I tried a couple of different notations like ${issue.customfield_14020}. However they result in a blank value.

Can I make this work or should I script the whole sub-task creation?

2018-02-19 09_26_25-Update Workflow Transition Script Post-Function Function - Bayer Cropscience CLS.png

 

1 answer

0 votes
Charlie Misonne
Community Champion
February 19, 2018

In the meantime I'm doing this in the Additional issue actions:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField;
 

CustomField cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_14020");
def txt = sourceIssue.getCustomFieldValue(cf)

issue.summary = "Child - ${txt}"


It works fine but I'm still interested in a solution using the Subtask Summary field only.

Suggest an answer

Log in or Sign up to answer