Trying to Pull the TASK Number on a Create Task Activity in a Workflow

John Bone
Giga Expert

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!

1 ACCEPTED SOLUTION

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

View solution in original post

7 REPLIES 7

Hi,

you can get the task number of the task you are trying to create using Catalog Task Activity

here is the solution

How to access the catalog task number within the Workflow Activity creating the task?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@John Bone 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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