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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

135 views 5 9
Read article

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