How to copy incident fields to request fields while creating request from an incident through 'Create Request' button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 10:10 AM
Hi all,
I was trying to add 'Create Request' button on Incident form that should redirect to service catalog page, and after opening one of the request form from there it should have some fields like 'requested_for', 'short_description' auto-filled (copied from that incident through which we have clicked on 'create request' ) .
I have added button which is redirecting to service catalog page but doesn't have any idea how can I make those fields on request form prefilled.
Is there any way to do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 10:20 AM
Hi
There is already an OOB button present on the incident form to create requests from incidents. No need to create new button for that.
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Gunjan Kiratkar
Consultant - ServiceNow, Cloudaction
Rising Star 2022
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 10:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 10:42 AM
Hi
Check out the below thread it will show you how to pass parameters from URL and then fetch that using the client script.
Prepopulate fields on a service catalog item using a URL
3 Ways to Populate Values in ServiceNow via the URL
Regards,
Gunjan
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:05 AM
Hi @khushboo
Regards,
Shloke
In that case, you need to create a UI Action on your Incident form and use the script as below:
Screenshot of UI Action below:
So when you will click on the button on your Incident form it will form the URL with the value which you need and then you need to follow below steps:
1) Write a On Load Catalog Client Script on your Catalog Item and use the script as below:
This way you can add your other variable as well. This is working for me as shown below:
Result:
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke