Adding variable values to additional comments within a workflow

matthew_hughes
Kilo Sage

I've got a catalogue item that populates the selected Configuration item within the 'configuration_item' field of the form,.

 

Additional comments screenshot.png

I've got a workflow activity that sends additional comments to the requestor if it's not approved within 30 days. 

 

matthew_hughes_0-1681369555441.png

However, what I'm wanting to do is get the value of the 'configuration_item' and put the name and number into the Additional comments alongside the ones I've defined in the above screenshot. I was just wondering if this is possible to do.

 

 

3 REPLIES 3

Gopi Naik1
Kilo Sage

Hi @matthew_hughes ,

 

Instead of set value use Run script activity with below code:

current.comments="your text"+current.<configuration item field name>;

 

 

Ahmmed Ali
Giga Sage

Hello @matthew_hughes 

 

Use run script activity instead of set value activity. write below script in the activity:

 

current.comments = "Your_Text \n" + "Number: " + current.getValue("number") + "\nConfiguration Item: " + current.getDisplayValue("cmdb_ci");

AnveshKumar M
Tera Sage

Hi @matthew_hughes ,

You can use ${current.configuration_item.name} in between your text to refer a field value, otherwise you can use run script activity to set the values.