Help setting request short description
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 11:36 AM
Hi everyone,
I have a requirement to set the order guide request short description to include the variable answer of request_name. Currently the short description is showing the catalog item name instead. Attached is the code of the br I am using.
thanks in advance for any insight you can provide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:03 AM
hello @sushantmalsure
I'm sorry for the late reply. I'm not having much luck all around. I finally got the request script to work with the following below. However, I'm not sure what I'm doing wrong now with the description script to set the catalog item name if it is Project Manager Request. I've tried a million different options for the description and nothing is working. Would you mind reviewing what I have to let me know what I'm doing wrong. The request and request item for catalog item Project Manager Request, should both display variable name request_name in the short description and the request and request item should both display the catalog item name.
thanks in advance for any feedback you have!!
script used for request short description that is working--unless it is causing the issue with description?
tried
before and after insert
when to run description is empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:13 AM
have you changed the condition of BR as I mentioned earlier?
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:49 AM
Yes @sushantmalsure I did change the condition. Attached is the br for the request short description and br for the request item description. I've tried so many different variations with the script etc. I really appreciate all your help! Do I need 4 business rules to achieve the following:
1- Request Short description should be variable request_name if catalog item is Project Management Request Catalog
2- Request Item Short description should be variable request_name if catalog item is Project Management Request Catalog
3- Request description should be catalog item name if catalog item is Project Management Request Catalog
4- Request Item description should be catalog item name- if catalog item is Project Management Request Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:59 AM
I think you are complicating the things.
You just need 1 after insert business rule on sc_req_item table.
Deactivate the BR which you have on sc_request table.
Now the one you have on sc_req_item table remove the filter condition which you have added as (short description is empty) , add nothing in filter condition.
Finally in script I see you commented current.update() , uncomment that!
So the only BR on sc_req_item and following is updated script:
var gr_req = new GlideRecord('sc_request');
gr_req.addQuery('sys_id',current.request);
gr_req.query();
if(gr_req.next()){
gr_req.short_description = current.variables.request_name;
gr_req.description = current.cat_item.name;
gr_req.update();
}
current.short_description = current.variables.request_name; // this part is for setting short desc of RITM
current.description = current.cat_item.name;
current.update();
Note: do check if request_name is correct name for variable Request Name.
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 01:36 PM
Thank you @sushantmalsure I agree I was overcomplicating things. I made the changes you suggested and made some progress. Yay and Thank you !!! The request item is working perfectly now. The request item Short description has the variable request_name if catalog item is Project Management Request Catalog and the Request Item description has the catalog item name Project Management Request Catalog.
Unfortunately, the Request is not displaying correctly. The description is empty and should be the catalog item name Project Management Request Catalog, same as Request item. In addition, the request short description is displaying Project Management Request Catalog - Requested For : undefined. I believe the request is getting set because of a business rule our previous developer created for another catalog item. Do you have any suggestions to not impact other catalog items. Attached is the business role I believe impacting the suggestions you provided.
Request Item Short description should be variable request_name if catalog item is Project Management Request Catalog
3- Request description should be catalog item name if catalog item is Project Management Request Catalog
4- Request Item description should be catalog item name- if catalog item is Project Management Request Catalog