How to reference current task fields from the Catalog Task workflow activity?

Nick Peters
Tera Guru

Hello everyone,

I am using the Advanced script field on the Catalog Task workflow activity in order to create some custom text in the Description field of the current task. In particular, there are 4 fields/variables we would like to include - 2 variables from the current Catalog Item; the current task's number; and the current task's "Opened by" field (which is a reference to the sys_user table). I can get the Catalog Item Variables to appear but not the fields from the current Catalog Task.

Here is my code from the Advanced script of the Catalog Task where I am defining these values:

var emp = current.variables.employee_id + ', ';

var ldw = current.variables.last_day_worked + ', ';

var num = task.number + ', ';

var openedBy = task.opened_by.user_name;

What is the proper syntax for defining values from the current task? I have also tried:

  • current.task.####
  • current.sc_task.####

Again, the first 2 lines are generating values - lines 3 and 4 are not.

1 ACCEPTED SOLUTION

dvp
Mega Sage
Mega Sage

Other   way you can do is once task is created use run script and query the task and update the description field with the task values


View solution in original post

5 REPLIES 5

cherylmansa
Kilo Contributor

Hey there Nick! I was looking for that same answer myself. This may help you Create Task workflow activity   or http://www.synq.cloud. I hope that helps you find the answer you are looking for - Cheryl