Opened By field is empty on SCTASK

_Yash24
Tera Guru

Hi All,

 

We have New Hire order guide and user is ordering through Laptop Standard catalog item based on certain condition.

Catalog item has Requested For & Requested By variables and many more.

Requested By is hiding through catalog client script.

Once user submits the order, REQ is getting created and populating Opened By field for REQ and RITM however,  some of the sctask's it is populating Opened By field and for some of the sctask;s, it is showing as empty.

 

We observed that Opened By is Empty and Created by is System when I'm checking it on sc_task table list view.

 

Can someone help to understand what could be the issue?

 

Note: We have workflow for this and not Flow designer.

 

Thanks

2 REPLIES 2

palanikumar
Mega Sage

Hi,

Is there any pattern for the tasks where the created by is system?

As per my knowledge, the created by for any activity is based on the user who previously actioned on the workflow. For the first activity in the workflow, it runs as the user who submits the request. For activity after approval it runs as the approver. In your flow, if there is any timer or any activity where user is not involved then it runs as system.

For your case, I feel all the sc_task created as system might have a previous activity which is timer or activity where user involvement not present.

In this case, you can do this in Catalog task action:

1) Check Advance checkbox

2) In Script, add below code:

  task.opened_by = current.opened_by;

 

Thank you,
Palani

venkat917181
Tera Expert

 

Expected croot cause

1. Workflow Context Issues

  • Tasks created in different workflow contexts (user vs. system)
  • Workflow activities running under different user contexts
  • Timer/scheduled activities losing user context

2. Script Execution Context

  • Business rules/scripts running as "System"
  • Impersonation issues in workflow
  • Context switching between activities

3. Task Creation Method

  • Some tasks created via user-triggered activities
  • ******Others created via automated/system activities********(check this)
  • Different workflow paths for different conditions

Debugging Steps

  1. Check Workflow Context

    gs.log("Current user: " + gs.getUserID()); gs.log("Current user name: " + gs.getUserName())

  2. Check Business Rules

    • Look for BR on sc_task table with "When: before insert"
    • Check if any BR is overriding opened_by field