Workitem getting auto approved and moved to archived

Which IIQ version are you inquiring about?

8.5

Below is a part of workflow ,which i had added new step calling security certificate workflow , which is working as expected but result form is not showing in workitems and directly going to archived . but i didn’t any configuration in result form step . can you please suggest why it is not showing in workitems suddenly

<Arg name="identityName" value="script: return ($(identityModel.name));"/>
<Arg name="requestType" value="ref:requestType"/>
<Arg name="identityModel" value="ref:identityModel"/>
<Arg name="launcher" value="ref:launcher"/>
<Arg name="resultMsg" value="ref:resultMsg"/>
<Script>
  <Source>
    import sailpoint.server.Auditor;
    import sailpoint.object.AuditEvent;
    import sailpoint.tools.Util;
    log.error("audit step");
    if (!Util.nullSafeEq("LOA Update cancelled", resultMsg) &amp;&amp; !Util.nullSafeEq("Manual Termination process cancelled", resultMsg)) {
      String action = "checkListSubmit";
      if (Auditor.isEnabled(action)) {
        AuditEvent event = new AuditEvent();
        event.setAction(action);
        event.setTarget(identityName);
        event.setSource(launcher);
        event.setString1(requestType);
        event.setString2(resultMsg);

        Auditor.log(event);
        context.commitTransaction();
    log.error("audit step end");
      }
    }
  </Source>
</Script>
<Transition to="Initiate LCM Workflow">
  <Script>
    <Source>
      
      if (requestType.equalsIgnoreCase("Standard Access Request") || requestType.equalsIgnoreCase("New Temp or Contractor")) {
        if (exitWorkflow == void || exitWorkflow == null || exitWorkflow == false) {
          return true;
        }
      }

      return false;
    </Source>
  </Script>
</Transition>
<Transition to="Show Result Form"/>
import java.text.SimpleDateFormat; // Bug Fix: IS-5 - Request Date and Submitted By not showing on Confirmation Page SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm");
			return sdf.format(new Date());
          </Source>
        </Script>
      </Field>
      <Field columnSpan="1" displayName="Requested By" name="requesterName" type="string">
        <Script>
          <Source>
			import sailpoint.object.Identity;
			// Bug Fix: IS-5 - Request Date and Submitted By not showing on Confirmation Page
			Identity requester = context.getObject(Identity.class, launcher);
			String submittedBy = requester.getDisplayableName() + " (" + requester.getName() + ")";
			context.decache(requester);
			return submittedBy;
          </Source>
        </Script>
      </Field>
    </Section>
    <Section label="Submission Status" name="sectResults1" type="datatable">
      <Field name="Summary" type="string">
        <Script>
          <Source>
            import sailpoint.tools.Util;
            if (exitWorkflow != void &amp;&amp; Util.nullsafeBoolean(exitWorkflow) == true) {
              return "Request Cancelled.";
            } else {
              return resultMsg;
            }
          </Source>
        </Script>
      </Field>
    </Section>
    <Button action="next" label="Ok"/>
  </Form>
</Approval>
<Arg name="requestType" value="ref:requestType"/>
<Arg name="taskResultName2">
  <Script>
    <Source>
      if (wfcontext.getWorkflowCase().getTaskResult() != null) {
        wfcontext.getWorkflowCase().getTaskResult().setName(taskResultName);
      }

      return taskResultName2;
    </Source>
  </Script>
</Arg>
<Arg name="exitWorkflow" value="ref:exitWorkflow"/>
<Arg name="identityModel" value="ref:identityModel"/>
<Arg name="resultMsg" value="ref:resultMsg"/>
<Transition to="Check for Issues"/>
import sailpoint.tools.Util;
    //assume there was an issue
    boolean retVal = true;

    //but if we have something in resultMsg OR the caseName was populated, there is no issue
    if (Util.isNotNullOrEmpty(resultMsg) || Util.isNotNullOrEmpty(caseName)) {
      retVal = false;
    }
    if (requestType.equalsIgnoreCase("New Temp or Contractor") &amp;&amp; Util.isNotNullOrEmpty(identityId) &amp;&amp; plan ==null) {
      retVal = false;
    }
    return retVal;
  </Source>
</ConditionScript>
<Transition to="Stop"/>

Hello Saipriya. This could be happening if the owner on your Show Result Form approval step is resolving to null or an identity that can’t be found. When that happens, IIQ may complete the workitem without it ever showing up in the inbox, and it goes straight to archived.

Since this started after adding the security certificate subprocess, I would first check the launcher value right before the Show Result Form step. You can add log.error("launcher before result form: " + launcher); to confirm it’s not null at that point.

Passing launcher into the subprocess as an <Arg> won’t change it in the parent workflow. But if the subprocess step has any <Return> mapping writing back to launcher, that could overwrite it.

I would also open the archived workitem and check its Owner and Completer fields. If the owner is blank, that would confirm it. Fix the return mapping and make sure the Approval has something like:

<Approval mode="serial" owner="ref:launcher">

The archive configuration itself isn’t causing this. It only archives the workitem after the approval processing is already completed.

i had added a log for owner and it is getting resolved and workitem is getting all values

Thanks Saipriya. The owner is resolving correctly, so we can rule that out.

From what I can see in the screenshot(blurry), the work item was created and archived within about 18 seconds, so something is completing it almost immediately. It also looks like the Requester and Owner might be the same identity ID. Could you confirm whether that ID belongs to Saipriya Lingala? The Completed By value could just be showing the display name of the same identity.

The other thing I would check is whether the result form appeared anywhere in the browser after submission. Your form has:

<Button action="next" label="Ok"/>

Clicking that button advances the workflow to the next step, so if the form appeared during the request flow and was clicked, that could explain the quick completion.

If the form was never displayed or clicked, temporarily assign it to another test user. If it remains in that user’s inbox, that tells us the behavior is related to assigning the form back to the launcher. If it still goes straight to archive, please share the complete <Approval> block and the new subprocess step, especially any <Return> mappings or InterceptorScript.

You can also open the Debug pages, select WorkflowCase, and inspect the status recorded for the Show Result Form step. That should help identify where it’s being completed. The archive only stores completed workitems, so it’s the result of the completion, not the cause.

can you add return launcher after you audit step. The audit script had no return statement, so it was returning null. This step’s resultVariable is launcher, which fed the owner resolution on Show Result Form — a null overwrite there caused the work item to fail owner assignment and archive silently.

Auditor.log(event);
          context.commitTransaction();
      log.error("audit step end");
        }
      }

    return launcher;
    </Source>
  </Script>
  <Transition to="Initiate LCM Workflow">

Thanks for the reply let me try and comeback

Thank you it is working , one last issue was when i am rejecting the below form<?xml version='1.0' encoding='UTF-8'?>

RSLI Automated IS Checklist Review Form

the workitem is not getting closed and also not provisioning which is ok and approval is working

Glad that part is working now. For the rejection issue, I would check the button action in the RSLI Automated IS Checklist Review Form. If the Reject button is using

<Button action="cancel" label="Reject"/>

that would explain the behavior. cancel only closes the form and leaves the workitem active. It doesn’t complete it as rejected. Use action="back" instead

<Button action="back" label="Reject"/>

back sets the approval status to Rejected and advances the workflow. Also make sure the transition after the Approval routes the rejected path to your Stop or End step and doesn’t loop back to the same Approval.

The form XML didn’t display properly in your post. If you are already using action="back", please share the <Approval> block and the form button section inside a code block. That will help narrow it down.

Thanks for the reply it is working as expected