How Restrict the User to only one Request per catalog item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2020 10:57 AM
how can we restrict the user to only one request per catalog item if he has already an existing open request for that catalog item.
for example
If a user has an open request on catalog item 'X' again he is trying to raise the request for the same catalog item i want to restrict him from raising the request in such case how is it possible
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2020 11:51 AM
Hello Gowtham,
Create a on Before insert BR on sc_req_item
Conditions
Item is <your_cat_item> AND
state is open
Actions:
Select Abort Action
Add message : you already have a opened RITM.
Save
Mark the comment as a correct answer and also helpful if it helps to solve the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2020 03:11 AM
I tried this but REQ##### is generating in the Portal but RITM is not being created is there any way to prevent the REQ### also

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2020 11:51 AM
Do you want to stop creating the request itself or can you close the request as rejected if ritm exists?
If thats the case, then you can do it like this
In the above BR select advanced and under script add this code
var gr = new GlideRecord("sc_request");
if(gr.get(current.request)) {
gr.request_state= "closed_rejected";
gr.update();
}
gs.addErrorMessage("Request already exists for this user");
current.setAbortAction(true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2023 02:21 AM
Hi @asifnoor ,
I have similar requirement. Please help me. I have posted my question:
https://www.servicenow.com/community/now-platform-forum/restrict-submit-catalog-item-if-short-descri...
Thanks,
Samiksha
Mark the comment as a correct answer and also helpful if it helps to solve the problem.