Hi everyone,
I wanted to share a ScriptRunner Behaviour I recently developed for Jira Data Center that solved a business requirement in one of our approval workflows.
We wanted to automatically route requests to a supervisor for approval.
However, when multiple users are selected in a Multi User Picker, the request can only be routed automatically if all selected users report to the same direct manager.
To enforce this, I created a Behaviour that validates the selected users before the issue is created or updated.
sAMAccountName, userPrincipalName, or mailThis allows the approval workflow to safely determine a single supervisor without requiring users to manually select an approver.
I've published a generalized version of the script in my public Bitbucket repository:
👉 View the script:
https://bitbucket.org/gorgreyan/jira-scriptrunner-scripts/src/main/behaviours/validate-users-have-same-manager.groovy?at=main
This is the first script in the repository, and I plan to continue sharing reusable ScriptRunner examples for Jira Data Center. I hope they'll be useful to other Jira administrators and ScriptRunner developers.
I'd love to hear how you've approached similar requirements. Have you implemented manager-based approvals or reporting-line validation in your Jira environment? If so, did you use LDAP, another directory service, or a different approach altogether?
Gor Greyan
2 comments