How to create RITM automatically from choice in change

Jens Mogensen
Kilo Guru

Hi everyone

We have a Request Item designed for requesting that the Servicedesk makes announcements regarding service Windows. It's available on the service portal for anyone in IT.

Now management wants this request item to be a part of the change process. Basically they wish it to be possible to order this RITM by filling out fields on the change form.

 

What I've done so far:

On the Change form, I've made a new tab meant for the ordering of service Windows announcements ("Bestilling af udmelding"). This contains fields with the same names as the ones on the Request Item. Change Form:

find_real_file.png

 

What I do not know how to do is how to create a RITM with these field values included. I assume the best way would be via the change workflow. I could then make an "IF" branching that would be triggered by the first field above not being empty. Or maybe just add a yes/no checkbox which could trigger a specific branch of the flow.

In the workflow I've mad a "create task" box and set the task type to Requested Item:
find_real_file.png

 

Now here's the issue. How do I tell it to make a specific task with the values from my fields in the Change? If I chose to get the task values from "Fields" I get no way of designating which fields or which Request Item to create/populate with the values. 

If I choose "Values" then I can choose among what looks like every field except the new ones I created. 

find_real_file.png

 

Thanks for any suggestions.

 

1 ACCEPTED SOLUTION

Jens Mogensen
Kilo Guru

Thanks for all the suggestions everyone. We ended up with the following:

 

A button at the top op the change form ("Opret udmelding"):

find_real_file.png

 

Which triggers a UI action:

find_real_file.png

 

The effect of which is, that when you press the button a new tab in the browser windows is opened directly on the Catalog Item. As others mentioned this should be much more future proof and not break when Servicenow is upgraded to future versions.

View solution in original post

6 REPLIES 6

Suseela Peddise
Kilo Sage

Hi,

You can do through via workflow/business rule. May be after all approvals i.e after authorize state , you can create request based on the values filled in change form. Below is the sample script:

createRequest();

function createRequest() {

//Create cart
var cart = new Cart();
//add catalog item
var item = cart.addItem('<<item sys_id>>'); // replace with catalog item sys_id
//set variables

cart.setVariable(item, '<<variable_name>>', current.<<change field>>);//replace variable name and change field names
cart.setVariable(item, 'change', current.sys_id);

<<include all the variable value using above above format>>

var cartGR = cart.getCart();
cartGR.requested_for = current.<<requested_for>>;//replace change field value
cartGR.update();

var rc = cart.placeOrder();
rc.setValue('parent', current.sys_id);
rc.update();
cart.desciption = 'Robs test cart';

gs.addInfoMessage(gs.getMessage('Request created', [rc.getLink(), rc.number + ""]));
}

 

Hope this helps!

If I have answered your question, please mark my response as correct and/or helpful.

Thanks,

Suseela P.

 

Jens Mogensen
Kilo Guru

Thanks for all the suggestions everyone. We ended up with the following:

 

A button at the top op the change form ("Opret udmelding"):

find_real_file.png

 

Which triggers a UI action:

find_real_file.png

 

The effect of which is, that when you press the button a new tab in the browser windows is opened directly on the Catalog Item. As others mentioned this should be much more future proof and not break when Servicenow is upgraded to future versions.