Populating Change Task Short Description with values from a Change Form field

simonbourne
Kilo Contributor

I have a Record Producer that captures all the details for a standard change.  Once submitted the Record Producer activates a Workflow that generates a series of change Tasks, based on the content of fields.

Using this approach, how do I insert the value of a field directly into the Short Description of a Change Task.  For example, I raise a change to install software and the name of the client (MyCompany PLC) is captured on the Record Producer in the field Client.  The workflow will generate a Change Task.  I would like the change Task to have a Short Description of "Install software for MyCompany PLC"    

6 REPLIES 6

add .getDisplayValue() to the end of the one that is giving the sys_id.


Aditya Telideva
ServiceNow Employee
ServiceNow Employee

Hi Simon,


I have found the below code from others experiences:


Create a before business rule on the change task table



When: before insert and update


Conditions: Location changes


Script:


if(current.<location field value>!=''){


var gr= new GlideRecord('table name of PMI');


gr.addQuery('name field name on this table',current.<location field name on the current table>);


gr.query();


if(gr.next()){


current.<field name of PMI scheduled date on the current table>=gr.<field name of PMI scheduled date on PMI table>;


}


else{


current.<field name of PMI scheduled date on the current table>='';


}


Thanjs,


aditya Telidevara