How to get the user id of the Opened by to Created by in sctask (in workflow script)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 08:44 PM
Hi everyone,
I would like to check if how can I get the user id of the Opened by in SCTask to Created by field.
Here's a screenshot for reference.
The script i'm using in workflow catalog task is not working:
task.sys_created_by = task.opened_by.user_id;
Thanks in advance!
- Labels:
-
ITSM
-
ITSM: General
-
scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 10:45 PM
Hi @Rahul Talreja , unfortunately, it's not getting the user id of the requested by
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 10:52 PM
Hi @ss123 ,
try with,
task.sys_created_by = current.variables.requested_by.user_id;
also make sure you are using correct variable names according to your setup.
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 11:15 PM
thanks but still not working. Is there anything else backend that's updating this field?