Auto-populate Short Description with Text

nichostetler
Giga Contributor

Right now, I have a script that auto-populates the short description in the Requester Information, with what it inputs in the Server Name variable as shown in the attached image. The problem is, it only pulls the short description and doesn't add the text I want it to.

servicenow.PNG

Here is my code:

current.short_description = "Server Decommission request - " + current.variables.ShortDesc.getDisplayValue();

Note:

the Sever Name variable is ShortDesc

the Short Description is short_description

1 ACCEPTED SOLUTION

You don't have Insert or Update checked on the business rule. This leads me to believe something else is setting it because this business rule never ran!


View solution in original post

9 REPLIES 9

Chuck Tomasi
Tera Patron

Where is this script being run from Nic? A business rule? Before/after? Can you include a screenshot of the larger context?


The scrip is being run in the workflow.



servicenow2.JPG


Thanks Nic.



Where in the workflow is this being set? If possible, consider setting it from an BEFORE/INSERT business rule when the record is created instead.


It is running first in the workflow.


sn3.JPG



As far as creating a business rule when the record is created, how would I do that? We have business rules that run for all requests, but I want this business rule to run for only this item.