When a user submit the request, the RITM number should be autopopulated in the work notes.

priyanka58
Tera Contributor

When a user submit the request, the RITM number should be autopopulated in the work notes of that change request i.e. RITMXXXXXXXX is created.

18 REPLIES 18

I have just redirected the sys_id :

action.setRedirectURL("/sp?id=sc_cat_item&sys_id=060f3afa3731300054b6a3549dbe5d3e");

Hi @Ankur Bawiskar ,

Can you please put some light on this requirement?

Hello,

could you please explain me what I have to do in the UI action script.

If you have code for that please share with me.

 

Regards,

Priyanka Shukla

shloke04
Kilo Patron

@priyanka 

This is feasible and can be done. But before this would require input from you to suggest a approach in the right direction:

1) As per your question, when Request is submitted by the user, does this mean the change is also created at the same time when a user submits a request?

Also when a user submit a request how is your Change record getting linked to request and on what stage?

Can you confirm on this ?.

Generically speaking based on the info which you have shared, what you can do is write a Business Rule on Requested Item table as per details below:

BR Details:

Table Name: Requested Item

When: After Insert

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here\
	var gr = new GlideRecord('change_request');
	gr.addQuery('parent',current.sys_id);
	gr.query();
	while(gr.next()){
		gr.work_notes = current.number + ' is created';
		gr.update();
	}
	

})(current, previous);

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hello,

I tried with this code but not working.