When an issue is created, users have to manually select the reviewer of their task. The admin wants to set it automatically depending on the request.
This makes sense if, for example, a purchase over 100 dollars needs to be cleared by one department and a travel request needs to be cleared by your manager.
1. Select the onCreate transition of your workflow.
Remember this can only be accessed through the diagram, and not the text editor.
2. Click Add Scripted Function>Custom Scripted Function.
It is very important that this is the FIRST function if set on the onCreate transition, else it will not update your value.
3. Add the following code:
Please note that in this case study, we want to add reviewers for the two basic request types that require reviewers: "Purchase Over $100", and "Travel Request".
Line 10: This is how you would add a single user as a reviewer. Note the special character '$' needs to be escaped
Line 11: This is how you would add more than one user as a reviewer
Line 44: If you completely want to override this behaviour delete this line and make it "def list = "