Create an RITM when Idea is accepted. Catalog item is hidden in the Employee Center.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2024 07:19 AM - edited 06-06-2024 10:14 AM
Hi,
I have built a catalog item with its workflow. Its hidden in Employee Center for users to submit.
When an Idea is accepted , I want the RITM to be created with the Idea values that were submitted. Mapping the values basically. I want the Demand Number also on the RITM form.
Demand Number field exists on the Idea form.
If anyone can help me with the BR?
Idea - Label and Name
RITM - Question & Name -
Idea values have to map to the ritm variables.
I have an existing BR that creates a Demand when Idea is accepted.
When- before condition ; On "Update"
var demandTable = "dmn_demand";
if(GlidePluginManager.isActive('com.snc.project_management_v3')){
demandTable = SNC.PPMConfig.getDemandTable(current.getTableName());
}
var demand = new GlideRecord(demandTable);
demand.setValue("description", current.description);
demand.setValue("requested_by", current.u_required_completion_date_if_any);//requested_by
demand.setValue("portfolio", current.u_global_process_shared_services_area);
demand.setValue("portfolio", current.portfolio);
demand.setValue("primary_program",current.u_program);
demand.setValue("priority", current.priority);
demand.setValue("short_description", current.short_description);
demand.setValue("type", "project");
demand.setValue("submitter", current.submitter);
demand.setValue("parent", current.sys_id);
demand.setValue("idea", current.sys_id);
var dmnId = demand.insert();
demand.get(dmnId);
current.demand = dmnId;
current.stage = 'demand';
GlideSysAttachment.copy('idea', current.sys_id, 'dmn_demand', demand.sys_id);
var link = ' <a href ="/' + demandTable + '.do?sysparm_query=number%3D' + demand.getValue('number') + '">'+ demand.getValue('number') +'</a>';
var message = gs.getMessage("Demand {0} has been created");
message = message.replace("{0}", link);
gs.addInfoMessage(message);
When Idea is accepted Demand and RITM should be created. But in RITM , Demand Number should also be populated.
Thanks,
Vaishnavi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 04:59 AM
Hi Sasanka,
The RITM is not created 😞
When I clicked on "Accept" button, Demand was created. RITM was also created
Also, received the error mentioned in the screenshot.
But RITM was created without any details or variable section.
var ritmGr = new GlideRecord('sc_req_item');
ritmGr.initialize();
ritmGr.cat_item = '389e052687e20e909e70c91acebb351f'; // Replace with your catalog item sys_id
ritmGr.u_project_name = current.short_description;
ritmGr.u_project_description = current.description;
ritmGr.u_cost_center_c = current.u_cost_center; // Update this field if necessary
ritmGr.u_portfolio_c = current.portfolio;
ritmGr.u_program_c = current.u_program;
ritmGr.u_requested_for= current.u_requested_for;
ritmGr.u_manager = current.u_requested_for.manager;
ritmGr.u_request_made_by = current.submitter;
// Map Idea values to RITM variables
//ritmGr.variables.your_variable_1 = current.idea_field_1; // Replace with actual field mappings
//ritmGr.variables.your_variable_2 = current.idea_field_2; //
// Include Demand Number on RITM
ritmGr.variables.udemand_number = current.demand.number;
var ritmId = ritmGr.insert();
Thanks,
Vaishnavi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 05:29 AM
I have two Idea forms. Only when one of the form is submitted it should create an RITM.
Right now, its creating for both forms. which I do not want.
I think creating a new BR should work. I can add a condition there?
Or include in the code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 05:31 AM
REQ or Request number is not updated in the RITM record as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 01:21 PM
Hey @Vaishnavi35 ,
Looks like this needs further investigation. Can we connect over a call to discuss this sometime? I might be able to help.
Let me know what date/time works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 10:05 AM
Hi @SasankaV ,
I have created a new BR where I have added a condition so that it creates only for one of the record producers not the other one.
This part is working.
But the variable section is not populated nor the Request(REQ) number.
Thanks,
Vaishnavi