Clarity: Missing Created By Resource and Last Updated By Resource fields under the Resource Fields tab in process action items

Document ID : KB000049944
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

I have upgraded to Clarity 12.0 or higher and I can no longer find Created By Resource or Last Updated By Resource under the Resource Fields tab when I try to assign a resource to a process action item (or manual action). I want to be able to assign action items to these users in new processes.

Solution:

Explanation: These Resource Fields are no longer provided out-of-the-box in Clarity 12.0 and higher

  1. Create a lookup:

    • NAME: My Resource Lookup

    • ID: my_resource_lookup

    • Choose the Dynamic Query option

    • Use the binoculars to the right of Object to select Resource

    • Click the Submit button

    • Paste the following query in the Query Window and then click the "Save and Continue" button:
      SELECT @SELECT:users.ID:ID@,@SELECT:users.LAST_NAME:LAST_NAME@,@SELECT:users.FIRST_NAME:FIRST_NAME@,@SELECT:users.FIRST_NAME || ' ' ||LAST_NAME:FULL_NAME@FROM srm_resources users

    • In the Parent Window, make sure that ID is the Hidden Key. Display Attribute can be full_name or whatever you want. Click the "Save and Exit" button.

  2. Add 2 attributes to the idea object (or whichever object you are trying to use these fields for).

    • Open the Idea object and click on Attributes.

    • Give your attribute a name and ID. I chose "My Created By" and my_created_by.

    • Choose the Lookup data type.

    • Click on the Binoculars to the right of "Lookup" and choose the lookup you created in Step 1.

    • Click the Submit button.

    • Follow the same steps to create a second attribute called "My Last Updated By" with id = my_last_updated_by.

      NOTE: These attributes do not have to appear anywhere on the idea object. They just need to be present.

      NOTE 2: When you create a process and create an actiion item (manual) action, if you click on the binoculars to the right of Assignee and then click on the Resource Fields tab, these two attributes will be listed.

  3. Whenever you want to create a process that uses these attributes as assignees, add the following gel script to the Start step (or in the first step, whichever you prefer). This will populate those fields with the created_by or last_updated_by resource ids in subsequent steps.
    <gel:script xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:core="jelly:core"xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"xmlns:sql="jelly:sql" xmlns:xog="http://www.niku.com/xog"><gel:setDataSource dbId="niku" var="a"/><gel:persist var="myObjectID" value="${gel_objectInstanceId}" scope="INSTANCE"/>

    <sql:update dataSource="${a}">update odf_ca_idea set my_created_by = (select id from srm_resources where user_id = (select created_by from odf_ca_Idea where ID =${gel_objectInstanceId})) where ID = ${gel_objectInstanceId}</sql:update>

    <sql:update dataSource="${a}">update odf_ca_idea set my_last_updated_by = (select id from srm_resources where user_id = (select created_by from odf_ca_Idea where ID = ${gel_objectInstanceId})) where ID = ${gel_objectInstanceId}</sql:update>

    </gel:script>

Keywords: CLARITYKB, Process, manual action, action item, Resource Fields, Gel Script.