Prevent Story Points from being inherited in Scriptrunner Sub-task post-function

Anika Rani July 3, 2016

Hi there

I am using Script-runner Post-function to automatically create sub-tasks at certain points in my workflow. By default, sub-tasks inherit most fields from the parent task - which is great most of the time. 

However, I do not want the sub-task to inherit the Story Points field from the parent task. And I can't figure out a way to override this, or set it to null.

Any ideas on how to script this into the 'Additional Actions' ?

Thanks & regards

Anika

 

1 answer

1 accepted

1 vote
Answer accepted
Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2016

From this answer: https://answers.atlassian.com/questions/18812102

You can set the story points of the subtask in Additional Actions using the custom field manager.

def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Story Points'}
issue.setCustomFieldValue(cf, null)

In this context, issue refers to the subtask created.

Suggest an answer

Log in or Sign up to answer