We have a workflow for a service request that contains 2 approval steps visible on portal. If approver selects Reject request is transitioned to Canceled state and resolution is added by post function.
However service desk agents can also reject request from any status and resolution is provided in the Screen.
In both cases Reject is a transition from All to Canceled. But customers obviously do not see the Screen since they do not have access to Jira Core.
Is there a way to
1. if user is an agent then set resolution from Screen selection
2. if user is a customer then set resolution from a post function.
I tried adding another All->Canceled transition to workflow, but Jira prevents it.
As a solution I can create a separate Declined status for approvers, but it looks like an overkill for me.
I have experience in Groovy and can add a Groovy function to All->Canceled transition that would set the resolution conditionally from Screen or from predefined value. Is it achievable by Groovy script?