Any Idea on Inflight request for custom workflow form entitlement

I have created quicklink which is triggering my custom workflow and the form to select the entitlement.

I want to stop user from raising request for same entitlement again if previous request status is in progress .

anyone can please help me to achieve this ?or any idea reg the same.

Hi @Santosh_A_More ,

You can implement this check by adding a Validation Script to the entitlement selection field in your form. Within the validation logic, use a query on IdentityRequestItem to filter based on requestee identity and entitlement value.

If you get any IdentityRequestItem with above creteria, you can check whether the request item is for add or remove operation. if it is add operation, you can display the message to end user like added entitlement is aleady exist.

Please refer the validationn logic.

             <ValidationScript>
              <Source>
                import sailpoint.object.*;
                import sailpoint.tools.GeneralException;
                import org.apache.commons.lang.StringUtils;
                import sailpoint.tools.Message;
                 Message msg = new Message();
				 String identity_id = form.getField("identityName").getValue();
				 Idenitty identity = context.getObject(Identity.class,identity_id);
                if(entitlement != null){
                Iterator iterator = context.search("sql: select request_item from spt_identity_entitlement where identity_id = ' "+identity.getId()+" ' and value = ' "+entitlementValue+" ' order by created desc", new HashMap(), null);
                while(iterator.hasNext()){
                String row = (String) iterator.next();
                IdentityRequestItem item = context.getObjectById(IdentityRequestItem.class,row);
                 msg.setKey("Selected Entitlement already requested. Please select the different entitlement");
                }
                }
                return msg;			
              </Source>
            </ValidationScript>

Thanks Arun for your response :slight_smile: ,

I have implemented somewhat similar to this but withing workflow step, i am checking the entry in the db for the requested item with few conditions and able to achieve that.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.