Affects Version/s: 5.1.0
Fix Version/s: 5.4.34
ScriptRunner| 5.1.0 |
JIRA Software| 7.4.3 |
In JIRA you have the ability to automatically set default values for your custom fields via the custom field configuration page. However, if you set a custom field to have default values, they will not be set when creating a sub-task via the ScriptRunner Create Sub-task post-function as you would expect.
Steps to reproduce:
- Create a new custom checkbox field and give it some random options.
- Then configure that checkbox field to only appear on sub-tasks and set the default value of the field:
- Now configure a Create Subtask post-function that executes on a transition of your choice.
- Remember to publish the workflow before exiting
- Create a new issue for testing
- On your newly created issue, click the "More" tab and open the dialog to manually create a subtask. Notice that the values for your custom field are set to the defaults as you would expect.
- Exit that dialog without creating a sub-task and then execute the transition that you attached the Create Sub-task post-function to.
- Notice in the newly created subtask that the default values were not set!
In the additional issue actions field, include the following script