Script Runner: Create sub-tasks- error when clearing customfield

M Hoogenboom October 16, 2015

When I use Script Runners function "Create a sub-tasks" to create sub-tasks during a workflow post condition, it copies the Story Points from the parent to the newly created sub-task as well, which does not make much sense in our opinion.

So, now I'm clearing the field via the Additional issue actions. Why is this field copied from parent?

We have Script Runner version: 3.0.16. Plan to update to the paid version next year. 

Thanks.

Mariska.

1 answer

0 votes
Steven F Behnke
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.
October 16, 2015

I would imagine that all fields are being copied by the script. It's not looking at the words "story points" and deciding not to copy it, the logic is much more simple than that. Foremost, I would not recommend using Story Points on Sub-Tasks, so the easy fix here would be to hide that field within the sub-task field configuration for your project. smile

Secondly, you should take the Create Sub-Task script, which is included within your Script Runner package, the .jar file you've installed within your JIRA. You can open this file and locate all of the scripts, which are written in Groovy. This script should then be customized to fit your needs. So in this case, you'd desire logic to not copy the Story Points field, but otherwise remain the same. Then, you can use this script instead.

M Hoogenboom October 18, 2015

Thanks for your reply. However, I cannot disable story points on sub-tasks as quite a few projects want to use it (although I recommended against it), but still I would prefer having control over the fields being copied. Creating a subtask is not the same as creating a cloned issue. But thanks for your suggestion to customise the groovy script.

JamieA
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.
October 20, 2015

At some point I will make it much easier to configure the list of copied fields. The real issue is that this script and cloning an issue both share the same subclass... it makes sense when cloning, but not when creating a subtask. Normally.

M Hoogenboom October 20, 2015

Thanks. I've solved it now by cleaning the fields in the additional issue actions and keep your groovy scripts original.

Suggest an answer

Log in or Sign up to answer