function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ajay Sharma 73Ajay Sharma 73 

Validation Rule on Closure Ctaegory

I am trying to create a validation rule for closing ticket.
The Closure Category (Picklist) and Incident Resolution field must be completed before a ticket can be closed.
I am currently using this formula but its not working for me.
AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c, ''), $User.BMCServiceDesk__IsStaffUser__c=TRUE && BMCServiceDesk__Status_ID__c ="Resolved" && (ISBLANK(BMCServiceDesk__incidentResolution__c)))
 
Best Answer chosen by Ajay Sharma 73
Veenesh VikramVeenesh Vikram
Try using this one:
I replaced And with OR between the two conditions which must be satisfied for the record to get saved.

 AND((ISPICKVAL(BMCServiceDesk__ClosureCategory__c, '') || (ISBLANK(BMCServiceDesk__incidentResolution__c))),  $User.BMCServiceDesk__IsStaffUser__c=TRUE,BMCServiceDesk__Status_ID__c ="Resolved")

Kindly Mark solved if this works.

Regards
Veenesh

All Answers

Veenesh VikramVeenesh Vikram
Try using this one:
I replaced And with OR between the two conditions which must be satisfied for the record to get saved.

 AND((ISPICKVAL(BMCServiceDesk__ClosureCategory__c, '') || (ISBLANK(BMCServiceDesk__incidentResolution__c))),  $User.BMCServiceDesk__IsStaffUser__c=TRUE,BMCServiceDesk__Status_ID__c ="Resolved")

Kindly Mark solved if this works.

Regards
Veenesh
This was selected as the best answer
aniruddha maitianiruddha maiti
AND(ISPICKVAL(BMCServiceDesk__ClosureCategory__c, ''), ($User.BMCServiceDesk__IsStaffUser__c=TRUE && BMCServiceDesk__Status_ID__c ="Resolved" && (ISBLANK(BMCServiceDesk__incidentResolution__c))))
Basically, the AND is validating aginst only the 2 conditions..1st the closure category picklist value and 2nd the rest of the 3 conditions put in && condition. If any of the 3 fails, it will fail the 2nd and as such will fail the whole validation. is the condition for closure category picklist value blank?
Ajay Sharma 73Ajay Sharma 73
Thanks Veenesh, your solution worked. 
Ajay Sharma 73Ajay Sharma 73
Aniruddha, yes the closure category is set to blank before the ticket is closed.