Heya folks!
I kinda have a strange error I can't figure out. I want a sub task with the name of the month to be created based on the value of a custom field. So I created 12 post functions of 4 different kinds checking if the custom field "period" is set to "yearly", "half yearly", "quarterly", "monthly".
So I'm using the 12 post functions with the follwoing conditions and additional actions:
For post function 1,2,4,5,7,8,10,11:
Condition: issue.issueType.name == 'Task' && cfValues['Period']?.value == 'Monthly'
Additional Action: issue.summary = "January - "+sourceIssue.summary
(and same for February, April, May, etc.)
For post functions 3 and 9:
Condition: issue.issueType.name == 'Task' && (cfValues['Period']?.value == 'Monthly' || cfValues['Period']?.value == 'Quartery')
Additional Action: issue.summary = "March - "+sourceIssue.summary
(same for September)
For post function 6:
Condition: issue.issueType.name == 'Task' && (cfValues['Period']?.value == 'Monthly' || cfValues['Period']?.value == 'Quarterly' || cfValues['Period']?.value == 'Half Yearly')
Additional Action: issue.summary = "June - "+sourceIssue.summary
For post function 12:
Condition: issue.issueType.name == 'Task' && (cfValues['Period']?.value == 'Monthly' || cfValues['Period']?.value == 'Quarterly' || cfValues['Period']?.value == 'Half Yearly' || cfValues['Period']?.value == 'Yearly')
Additional Action:
Additional Action: issue.summary = "December - "+sourceIssue.summary
With that way I have 12 sub tasks being created if "Monthly is select, 4 sub tasks if "Quarterly" is select, 2 for "Half Yearly" and 1 for "Yearly". And each sub task will start with the correct month name.
All the post functions are working. However, now the problem: when I'm editing one of the post functions, even if I'm copy pasting the same code in, they stop working and do not create the sub tasks anymore. This is always only affecting the edited post function. That is very strange and I can't find the reason for it. The only way to get them to work again is, deleting it and then recreating it, which is painful if I want to change something in all 12 post function.
The error I'm getting then is:
2020-03-05 09:21:34,644 ERROR [workflow.AbstractScriptWorkflowFunction]: *************************************************************************************
2020-03-05 09:21:34,652 ERROR [workflow.AbstractScriptWorkflowFunction]: Script function failed on issue: ITIKS-30, actionId: 261, file: null
java.lang.NullPointerException: Cannot get property 'id' on null object
Does anyone have an idea or did encounter a similar problem? We are working with Jira version 7.12.3, which hopefully we will upgrade soon. But not sure if it may be related to that. I'm grateful for any idea 
In the screen below for example I edited function 12, which was working before but since the edit didnÄt work again even if I copy in the old code. The only time it worked again was when it wasn't triggered:

