...
Access Workflow Configuration:
Log in as a Jira administrator and navigate to Jira Administration > Issues.
Select Workflows and click on the workflow you want to edit.
Click Edit.
Add or Modify Validator:
Select the transition where you want to add the validator.
Click on Validators.
Add the Build-your-own Validator
Set the Validator Condition:
In the validator configuration:
1. Select Groovy Script
2. Add the following script:
Code Block currentUser.key == issue.project.lead
3. Add a desired error message
4. Click on Add.
Save and Publish:
Save the validator configuration.
Publish the workflow to apply the changes.
...