- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 05:30 AM
I have a reference variable on a catalog item called Project Reference Number: (u_project_reference_number) that is referencing the sc_task table. After looking at other Community posts, I am trying to pull the TASK number and populate it in this field on the Create Task activity in the catalog item's workflow using the script below, but it isn't working for me. This is the only line of code in the Advanced script section on this Create Task activity. Does what I need to do get this working?
workflow.scratchpad.u_project reference_number = task.number;
Thank you for your help!
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2022 09:33 AM
Hello @Ankur Bawiskar,
I appreciate the help, but it didn't work for me. Instead of pulling the TASK number and putting it into a variable on the catalog item workflow, the particular catalog item that I'm working with involves passing information over to another system by using a UI Action on the TASK that gets created by the workflow. Since the UI Action is on the TASK table, I was able to use current.number in the UI Action script to pass the TASK number to the other system.
Thank you very much,
Will Bone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 05:37 AM
Hi,
do this
task.myField = current.variables.u_project_reference_number.number; // give correct field where you want to set
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 05:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2022 06:35 AM
Hi,
the number field on task is auto-generated.
Why you wish to set it from script?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 06:26 AM
Hello
I am trying to get the TASK number so that I can pass the value to another system, so that the other system can use the TASK number to pass back a value of "Closed Complete" when the automation activities performed by the other system are successfully completed.
Thank you for your help!