Change description of WorkItem

IIQ Version

8.4

Debug Log

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE WorkItem PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<WorkItem created="1744261183156" handler="sailpoint.api.Workflower" id="7f0001019616110f81961e1176b31684" identityRequestId="0000000083" level="Normal" modified="1744261183207" name="0000000052" renderer="lcmEditableWorkItemRenderer.xhtml" significantModified="1744261183207" targetClass="sailpoint.object.Identity" targetName="test" type="Approval">
  <Attributes>
    <Map>
      <entry key="approvalSet">
        <value>
          <ApprovalSet>
            <ApprovalItem application="IIQ" id="4db7c8e916164bb6a0894c136306568b" nativeIdentity="test" operation="Create">
              <Attributes>
                <Map>
                  <entry key="attachments"/>
                  <entry key="email:[email protected]">
                    <value>
                      <Attributes>
                        <Map>
                          <entry key="type" value="string"/>
                        </Map>
                      </Attributes>
                    </value>
                  </entry>
                  <entry key="manager:Annabel Stracke">
                    <value>
                      <Attributes>
                        <Map>
                          <entry key="type" value="sailpoint.object.Identity"/>
                        </Map>
                      </Attributes>
                    </value>
                  </entry>
                  <entry key="name:test">
                    <value>
                      <Attributes>
                        <Map>
                          <entry key="required">
                            <value>
                              <Boolean>true</Boolean>
                            </value>
                          </entry>
                          <entry key="type" value="string"/>
                        </Map>
                      </Attributes>
                    </value>
                  </entry>
                  <entry key="password:1:ACP:5eO/Vi32Xrh8uTyaB96Hn2h2F7k43ghN3Uo+Kgy2Hhc=">
                    <value>
                      <Attributes>
                        <Map>
                          <entry key="required">
                            <value>
                              <Boolean>true</Boolean>
                            </value>
                          </entry>
                          <entry key="secret" value="true"/>
                          <entry key="type" value="secret"/>
                        </Map>
                      </Attributes>
                    </value>
                  </entry>
                  <entry key="useBy:Sat May 10 11:59:42 ICT 2025"/>
                </Map>
              </Attributes>
              <value>
                <List>
                  <String>name = 'test'</String>
                  <String>email = '[email protected]'</String>
                  <String>manager = 'Annabel Stracke'</String>
                </List>
              </value>
            </ApprovalItem>
          </ApprovalSet>
        </value>
      </entry>
      <entry key="identityDisplayName" value="test"/>
      <entry key="identityName" value="test"/>
      <entry key="policyViolations"/>
      <entry key="workItemDescription" value="Account Changes for User: test"/>
      <entry key="workItemElectronicSignature"/>
      <entry key="workItemForm">
        <value>
          <Form name="LCM Identity Approval" type="Workflow">
            <Attributes>
              <Map>
                <entry key="subtitle" value="lcm_identity_approval_subtitle"/>
              </Map>
            </Attributes>
            <Section name="IIQ:test">
              <Field displayName="att_user_name" name="IIQ:name" required="true" type="string" value="test">
                <ValidationRule>
                  <Reference class="sailpoint.object.Rule" id="7f00010196161e778196165f438301ae" name="LCM Validate Identity Name"/>
                </ValidationRule>
              </Field>
              <Field displayName="Password" name="IIQ:password" readOnly="true" required="true" type="secret" value="1:ACP:5eO/Vi32Xrh8uTyaB96Hn2h2F7k43ghN3Uo+Kgy2Hhc="/>
              <Field displayName="Email" name="IIQ:email" type="string" value="[email protected]"/>
              <Field displayName="att_manager" name="IIQ:manager" type="sailpoint.object.Identity" value="Annabel Stracke"/>
            </Section>
          </Form>
        </value>
      </entry>
      <entry key="workItemPriority">
        <value>
          <WorkItemLevel>Normal</WorkItemLevel>
        </value>
      </entry>
    </Map>
  </Attributes>
  <Description>Identity Approval - Account Changes for User: test</Description>
  <Owner>
    <Reference class="sailpoint.object.Identity" id="7f0001019616110f819616746dc00056" name="Annabel Stracke"/>
  </Owner>
  <Requester>
    <Reference class="sailpoint.object.Identity" id="7f00010196161e778196165f180900ff" name="spadmin"/>
  </Requester>
  <WorkflowCaseRef>
    <Reference class="sailpoint.object.WorkflowCase" id="7f0001019616110f81961e1175d0167d" name="Update Identity test IdentityCreateRequest - 5"/>
  </WorkflowCaseRef>
</WorkItem>

Details

I was checking the debug page and found this log message, which contains the WorkItem object. I’m trying to figure out how to automatically update the description field.

Should I be working on the LCM workflow to achieve this? I’m not sure where to start. I’ve tried several approaches, but I’m still stuck. I’m a beginner, so I would really appreciate it if you could point me in the right direction or provide some guidance.

And I still want to grab the email details of user approval to replace the description for WorkItem

Thanks so much in advance!

Business Process

Hi @fewthiraphat

As part of the OOTB feature, when you create or edit an identity, it triggers the 'LCM Create and Update’ workflow, which in turn triggers the subprocess ā€˜Identity Request Approve Identity Changes’. This subprocess uses the ā€˜LCM Identity Approval’ form. Typically, updating the subtitle in this form will update form’s title and not workitem description, or passing the ā€˜workItemDescription’ in the Approve step should be suffice to update workitem descrption however, it is being overwritten later during the ā€˜Build Approvers If Necessary’ step. Therefore, I recommend adding a custom step after ā€˜Build Approvers If Necessary’ to update the workitem description as below(Custom Step). If you want form title also to be changes, then update subtitle entry in ā€˜LCM Identity Approval’ form

  <Step action="call:getIdentityCreateUpdateApprovals" condition="script:isNull(approvers)" icon="Task" name="Build Approvers If Necessary" posX="429" posY="12" resultVariable="approvers">
    <Description>
      If the approvals weren't passed in then build them up using our
      default rule.
    </Description>
    <Transition to="Custom Step"/>
  </Step>
  <Step icon="Task" name="Custom Step" posX="429" posY="12" resultVariable="approvers">
    <Description>
      If the approvals weren't passed in then build them up using our
      default rule.
    </Description>
    <Script>
      <Source>
        import sailpoint.object.Workflow.Approval;
        
        if(approvers != void &amp;&amp; approvers != null){
        
        for(Approval approval : approvers){
        
				approval.setDescription("Customized description");
        }
        
        }
        return approvers;
        
         </Source>
    </Script>
    <Transition to="Approval"/>
  </Step>
1 Like

Thank you so much, this is really helpful! :folded_hands:
If you don’t mind, I have one more question,
how can I retrieve the email from the ā€œCreate Identityā€ form and display it in the description?

If I’m not wrong, you need to fetch form from item (workitem) as shown below and see if you can see email address details in it.

Form form = item.getForm();
 if (form != null) {
                  Field field = form.getField("email"); // Keep your field name.
                  if (field != null) {
                      String emailValue = field.getValue();
                      //Set description here
                  }

}

That’s work, Thank you a lot! :grinning_face: