Users name to display in Short Description

johny0555
Kilo Contributor

Hello,

We have it set up so that a user can request a piece of hardware / software in ServiceNow Self-Service.

When they request this hardware / software, it is sent to their manager for approval and a call will be logged on out side stating 'Hardware Request for Joe Bloggs' in the short description. So it will display the users name.

Recently, I added some new hardware to the self service catalogue and it follows the same workflows as previous hardware requests, however the new hardware states 'Hardware Request for Undefined'

Does any body know how I can get it to display the users name like our previous hardware requests rather than it displaying 'undefined'?

Below is a screen shot of some stating the users name in the short description and some stating 'undefined'

Thank you.

find_real_file.png

9 REPLIES 9

As chuck said, look in business rules on sc_request table and put in the filter script contains short_description.



Thanks,


Abhinay


Chuck Tomasi
Tera Patron

Somewhere you have a business rule or other script that should say:



current.short_description = 'Hardware request for ' + current.requested_for;


Hi, I believe this is the script:



var gr_req = new GlideRecord('sc_request');


gr_req.addQuery('sys_id',current.request);


gr_req.query();


while(gr_req.next()){


//gs.log('found request'+ current.request.getDisplayValue());



var req = current.variables.full_name.getDisplayValue();



gr_req.short_description = "Hardware Request for " + req;


gr_req.update();


}


Hi John,



I think you've found it, but it is hard to tell what context this is running in. Can you also provide the value of the fields: Table and When?



I have a sneaky suspicion we can shorten this up to 1 line (the one I wrote before.)


John,



  In the catalog item,   variable "full_name" a reference field?



Thanks,


Abhinay