Hi there,
I've been racking my brain around this for a while but feel like my scriptrunner knowledge just isn't good enough 
My requirement is that when a user creates a request through the portal and they check box/set a value somewhere that an attachment becomes mandatory.
Now we have Scriptrunner so adding it as a Custom script validator on the create transition should do the trick.
Going back to the documentation, this works fine but only when I do it on the agent view. When it is submitted through the portal the form token is empty and thus it doesn't trigger.
https://scriptrunner.adaptavist.com/6.19.0/jira/recipes/workflow/validators/validate-attachments-links-in-transition.html
Anybody got some ideas whether the form token needs to get capture differently when on the portal or just a different way of doing this?
I cannot make the field mandatory all the time as it is only under certain conditions required.
Thanks for any feedback!