Request item auto-close after creation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2023 06:51 AM
How to make request item auto-close after submission or creation?
No certain number of days, just upon submitted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2023 08:51 AM
Hi @Vengeful
To make requested item auto-close upon submission or creation, you can create a business rule that triggers when the item is submitted.
The rule can include a script that sets the state of the item to closed, there are few examples of similar business rules.
Possible to only request an item x number of times a day
Auto close Requested Items
It is also possible to create a client script that calls a script include using Glide Ajax to set the state of the item to closed.
Please mark helpful/correct, if your query is addressed and/answered!
Thanks,
Vamshi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2023 03:29 PM - edited ‎04-26-2023 03:30 PM
Hello @Rao Vamshi
I tried the "Possible to only request an item x number of times a day " since it's for a certain catalog item, but there's an error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2023 11:17 PM - edited ‎04-27-2023 12:35 AM
Hi @Vengeful
Can you try this script which can be used in BR that actually triggers when a requested item is submitted. It is checking, if there are any open request items associated with the current request and when found there are no open request items, the script sets the state of the request to 'Closed Complete'.
if (current.state == 'Closed Complete') {
return;
}
var gr = new GlideRecord('sc_req_item');
gr.addQuery('request', current.request);
gr.addQuery('state', '!=', 'Closed Complete');
gr.query();
if (!gr.hasNext()) {
current.state = 'Closed Complete';
}
})(current, previous);
Let me know if you have any further queries.
In case of query been addressed and/or answered, please mark helpful/correct!
Thanks,
Vamshi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2023 10:05 AM
Hi @Rao Vamshi
Is this for a specific request item or service catalog item?