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

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

Accepted Answer
1 vote

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
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

21,900 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you