How to create RITM through the event that fired from the another workflow ?

Ashish Das
Tera Contributor

Hi All,
I have one order guide, that creates one RITM , on the RITM workflow activity an event was fired that creates one new RITM and attached
to the same Request. But the RITM is not triggering/attached the workflow for that particular RITM that created from the event.


How to find that where the event is creating that RITM and why its not triggering the workflow?

Please help me on this issue.

 

Thanks,

Ashish

2 REPLIES 2

Shaqeel
Mega Sage

Hi @Ashish Das 

 

Creating a Requested Item (RITM) through an event that is fired from another workflow involves several steps.

Here's a summary:

 

1. **Create a Custom Event**: Navigate to System Policy > Events > Registry. Click on New to create a new event. Fill in the necessary details like Name, Description, etc.

 

2. **Create a Workflow**: Navigate to Workflow > Workflow Editor. Click on New to create a new workflow. Design the workflow as per your requirements.

 

3. **Add a 'Fire Event' Activity**: In the workflow, add a 'Fire Event' activity where you want to trigger the event. Configure the 'Fire Event' activity to trigger the custom event you created in step 1.

 

4. **Create a Business Rule**: Navigate to System Definition > Business Rules. Click on New to create a new business rule. This business rule will be triggered when the custom event is fired.

 

5. **Configure the Business Rule**: In the business rule, set the 'When to run' section to 'on Event'. Set the 'Event name' to the name of the custom event you created in step 1.

 

6. **Write a Script**: In the 'Advanced' tab of the business rule, write a script to create a new RITM. You can use the GlideRecord API to create a new record in the 'sc_req_item' table.

 

Here's a sample script:

javascript

var gr = new GlideRecord('sc_req_item');

gr.initialize();

gr.short_description = 'New RITM';

gr.description = 'This RITM was created by a custom event'; gr.insert();

 

7. **Test the Workflow**:

 

Finally, test the workflow to ensure that the RITM is created when the event is fired.

 

Remember, this is a basic example. You may need to customize the script based on your specific requirements.

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

One question, does this action of opening RITM by event violate ITIL and is it not possible to lose servicenow support?