- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 12:25 PM
Is it possible to create multiple change requests from one record producer?
We are looking for a way to stream line submissions of change requests in instances where the same change applies to multiple CI's.
I've added a List Collector to my record producer and need to create one new change request for each value selected.
For example, user selectes 3 values in the list collector: Value 1, Value 2, Value 3. After the user populates all other required fields and clicks submit I need 3 distinct change requests to be created with CR 1 populated with Value 1, CR 2 pop'd with Value 2, etc
Kelly
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 01:02 PM
Hi Kelly,
It is possible to create multiple change_request from a single record producer. I have tested this as below:
1. Create a record producer which looks like:
Script in the image is (can paste directly 😞
------------------------------------------------------------------------------------
var numOfConfigItems = [];
if (producer.list_collector) {
numOfConfigItems = producer.list_collector.toString().split(','); // get list of cmdb_items
}
for (var i = 0; i < numOfConfigItems.length; i++) {
current.initialize();
current.short_description = "test"; // This is how common properties will be set for the change_requests
current.cmdb_ci = numOfConfigItems[i];
current.insert();
}
current.setAbortAction(true); // default insert stop
--------------------------------------------------------------------------------------
2. Create a variable (which I think you have already created), which is of list collector type (name = "list_collector" used above).
3. Above example creates change requests with description as "test" for each ci_item.
Hope this helps.
Thanks,
Himanshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 03:59 PM
Yes, its possible. Check the discussion below:
How to Create a dynamic change task from a list collector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2017 01:02 PM
Hi Kelly,
It is possible to create multiple change_request from a single record producer. I have tested this as below:
1. Create a record producer which looks like:
Script in the image is (can paste directly 😞
------------------------------------------------------------------------------------
var numOfConfigItems = [];
if (producer.list_collector) {
numOfConfigItems = producer.list_collector.toString().split(','); // get list of cmdb_items
}
for (var i = 0; i < numOfConfigItems.length; i++) {
current.initialize();
current.short_description = "test"; // This is how common properties will be set for the change_requests
current.cmdb_ci = numOfConfigItems[i];
current.insert();
}
current.setAbortAction(true); // default insert stop
--------------------------------------------------------------------------------------
2. Create a variable (which I think you have already created), which is of list collector type (name = "list_collector" used above).
3. Above example creates change requests with description as "test" for each ci_item.
Hope this helps.
Thanks,
Himanshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2019 01:02 AM
How to do you add attachment to the multiple records you created from the script?