Automatically update the short description in request, ritm and sctask?

Moedeb
Tera Guru

This question has been asked and answered in the past (even by myself), however I have tried all those and they are not working for me at all.

What I want should be fairly simple I would think. I have a Catalog Item with a select box and in that it decides the type of request that it is going to be, all I want is for the short description for the Request, Requested Item and the Task to be the same, but to use field contents to assist with making them mean something when looking through a list of them.

find_real_file.png

So as I've shown in the screen shot, something like this:

- Request creation of a [account_name] for [user_name].

I would really appreciate some help with this, thanks

 

1 ACCEPTED SOLUTION

Raf1
Tera Guru

Hi Moe,

You can try the following:

1. For updating RITM short description, you can use a before business rule on sc_req_item table and use this line in the script:
current.short_description= 'Request creation of a ' + current.variables.<account name variable name> +' for ' + current.variables.<users variable name> +


2. For updating the Request short description, You can add a runscript in the workflow mapped to a catalog item like:

var gr = new GlideRecord('sc_request');
gr.addQuery('sys_id', current.request);
gr.query();

if(gr.next())

{

gr.short_description = current.short_description;
gr.update();


}

 

3. For updating the task short description, In the same workflow at the catalog task activity you can add the following scripts:

Advanced section:
task.short_description = current.short_description;

 

Regards,

Raf

View solution in original post

8 REPLIES 8

I would actually update the RITM description in the Workflow as well so the logic is all in one place.  Add a "Run script" activity at the beginning of the workflow and update the Short description there instead of a Business Rule.

For the users name, you can get it from the Requested for field on the Request record:

current.request.requested_for.getDisplayValue()

I tried putting the ritm short descr through workflow, but it takes the catalog items short description.

PrashanthiS
Tera Contributor

Can we create only one business rule to update short description in request, RITM and task without writing any script in workflow.

@PrashanthiS as the business rules work on a table this would generally not work and I'd suggest if you were able to make it work it would not be advisable to do so.