Trying to embed variable into Short Description field on TASK

Daniel O_Connor
Kilo Guru

Hi all,

To try make life easier for the team, I'm trying to embed an Employee Name (variable) into the Short Description of a TASK. These TASKS are for joiners, movers and leavers and the existing Short Description requires the team to drill into the ticket. Seemingly will make life easier if they can see the emp name in the list view, especially when reviewing what has been actioned during a week or month.

I've added a Switch into my workflow, that based on the Item type (Joiner, Mover, Leaver) the Short Description will append the employee name variable 

An example below is of Joiner, and it is working as expected. This was added as an advanced script

task.short_description = (current.short_description+ " - " +current.variables.emp_name) ;

Should note this variable is a single line text field.

When I try do this for mover or leaver, I'm getting the below result

task.short_description = (current.short_description+ " - " +current.variables.emp_name_mover) ;

find_real_file.png

Gut is telling me it's something to do with the variables on leaver and mover being reference fields, where as joiner is just a string?

Any help would be appreciated

1 ACCEPTED SOLUTION

Shamma Negi
Kilo Sage
Kilo Sage

Hi,

 

For any field/ variable which is reference please use the below code:

current.variables.emp_name_mover.getDisplayValue();

getDisplayValue() will help in getting the display value of every reference field.

All reference field return "Sys_id" of the record.

 

Regards,

Shamma

Regards,Shamma Negi

View solution in original post

6 REPLIES 6

Mike Patel
Tera Sage

change below

current.variables.emp_name_mover.getDisplayValue();

Thanks Mike, worked perfectly

My answer was same as other so not sure why his answer was mark correct ?

Shamma Negi
Kilo Sage
Kilo Sage

Hi,

 

For any field/ variable which is reference please use the below code:

current.variables.emp_name_mover.getDisplayValue();

getDisplayValue() will help in getting the display value of every reference field.

All reference field return "Sys_id" of the record.

 

Regards,

Shamma

Regards,Shamma Negi