Use general program mode:
PHP Code:
program:
strcat(
template("{author_sort}/{title}/{author_sort} - {series:|[|}"),
ifempty(
finish_formatting(
field('series_index'),
'0>3',
' ',
'] '
),
finish_formatting(
format_date(
field('pubdate'),
'yyyy'),
'',
' (',
')'
)
)
)