OSWorkflow failed on Jira version 8.18

We are using OSWorkflow.
Recently we have found below exception in the log with Jira V8.18
Because of this error, the OSWorkflow is failed.

2021-07-11 16:19:16,537+0530 Caesium-1-3 ERROR ServiceRunner     [c.a.jira.workflow.DefaultOSWorkflowConfigurator] Rejecting usage of unsafe workflow function/class: `<our package name>.service.workflow.condition.PermissionCondition`. You can enable usage of this class by adding `com.atlassian.jira.security.LegacyJiraTypeResolver.WARN_ONLY.enabled` dark feature flag to Jira. Do it only if you are sure its known and secure case. It will make Jira vulnerablefor potential attacks.

If we enabled this then working properly.
But we need to fix this.
This is our OSWorkflow.xml.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.8//EN" "http://www.opensymphony.com/osworkflow/workflow_2_8.dtd">
<workflow>
	<initial-actions>
		<action id="1" name="Distribute">
			<meta name="addon.i18n.submit"><our package name>.form.distribute</meta>
			<meta name="addon.i18n.title"><our package name>.form.distribute</meta>
			<meta name="addon.description"><our package name>.form.distribute</meta>
			<meta name="addon.dist.status.id">1</meta>
			<meta name="addon.dist.user.status.id">1</meta>
			<restrict-to>
				<conditions>
					<condition type="class">
						<arg name="permission">HAS_DISTRIBUTION_PERMISSION</arg>
						<arg name="class.name"><our package name>.service.workflow.condition.PermissionCondition</arg>
					</condition>
				</conditions>
			</restrict-to>
			<results>
				<unconditional-result old-status="null" status="Open"
					step="1">
					<post-functions>
						<function type="class">
							<arg name="class.name"><our package name>.service.workflow.function.form.DistributeForm</arg>
						</function>
						<function type="class">
							<arg name="class.name"><our package name>.service.workflow.function.form.AssignToReviewer</arg>
						</function>
						<function type="class">
							<arg name="class.name"><our package name>.service.workflow.function.form.SendFormActionMail</arg>
							<arg name="mail.action">1</arg>
						</function>
					</post-functions>
				</unconditional-result>
			</results>
		</action>
	</initial-actions>
	<common-actions>
	<action id="21" name="Distribution Close">
			<meta name="addon.i18n.submit"><our package name>.form.distribution.user.close</meta>
			<meta name="addon.i18n.title"><our package name>.form.distribution.user.close</meta>
			<meta name="addon.description"><our package name>.form.response.close.confirmation.message</meta>
			<meta name="addon.user.action">false</meta>			
			<results>
				<unconditional-result old-status="Open" status="close" step="-1">
					<post-functions>
						<function type="class">
							<arg name="class.name"><our package name>.service.workflow.function.form.DistributionUserClose</arg>
							<arg name="status">3</arg>
						</function>
						
					</post-functions>
				</unconditional-result>
			</results>
		</action>
	</common-actions>
	<steps>
		<step id="1" name="Open">
			<actions>
				<common-action id="21" />
				<common-action id="22" />
				<common-action id="5" />
				<common-action id="2" />				
			</actions>
		</step>
		<step id="3" name="Re-Opened">
			<actions>
				<common-action id="5" />
				<common-action id="2" />
				<common-action id="21" />
				<common-action id="22" />				
			</actions>
		</step>
	</steps>
</workflow>

Please note that if I removed <our package name>.service.workflow.condition.PermissionCondition this condtion then error occures for next class,
.service.workflow.function.form.DistributeForm

Thanks in advance.