Create Request from Incident Business Rule

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2018 12:00 PM
Having an issue creating a request from an incident through a Business Rule. I'm able to get the request and request item created, but I'm not able to copy any variables from the Incident to the Request Item.
I would like to create a relationship between them or at least have the incident show in the 'Parent' field for reference. Once that is accomplished I might want to copy over other fields as well.
I'm creating the request with an after business rule and the following code:
createRequest();
function createRequest(current,previous)
{
var cart = new Cart();
var item = cart.addItem('fa593675db682380183464904b96198a');
var rc = cart.placeOrder();
gs.addInfoMessage('New/Update Configuration Item Request Created');
}
The business rule is triggered by a specific field being selected on the form. The business rule is triggering off the Task table since I'm going to want this to also apply to problems and changes.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2018 05:33 AM
hey! sorry for the delay in my response, but we had our go-live last week. I've not had a chance to review and test your code yet, but I hope to in the near future.
I'll make sure to let you know how it goes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2018 12:33 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2018 12:37 PM
I need the request to be made automatically based on the value of a specific field on the form. I didn't this this would apply since it is a button that the user can choose.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2018 12:49 PM
You can copy code from UI action in your business rule.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2018 12:59 PM
Well as I said I'm able to get the request created, it's copying the variables which is the issue.