Can I Create a Business Rule Related List of Request Item

Robert Campbell
Tera Guru

The overall goal is to track the creation of scripts. I would like to allow people to request functionality and if we need to build scripts to achieve the functionality I want to tie that script to the request.

 

If I cannot do this, I guess I will add a journal and make it mandatory and by process require a RITM # be added to the journal for each update.

 

RobertCampbell_0-1717103269774.png

 

8 REPLIES 8

I was working too long apparently because when I looked at the script this morning, I was like "why did you do that?" It all works now.

 

My thought is that the developer would always be adding the RITM to the BR and never the other way around. I can't think of a use case where someone would have to link the BR to the RITM at the RITM. I guess if the developer is putting it in because they know they need to do the work, but I wouldn't want them to link them until they actually do the work to ensure they didn't decide to create a new BR rather than use an existing one. 

 

I guess if it's needed, we'll cross that bridge when we come to it.

 

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

	var gr = new GlideRecord('x_245394_scripts_0_scripts_requests');
	gr.initialize();
	gr.business_rule = current.sys_id;
	gr.requested_item = current.u_requested_item;
	gr.insert();
	
})(current, previous);

RobertCampbell_0-1717414849037.png

RobertCampbell_1-1717414876515.png

RobertCampbell_2-1717414968471.png

 

 

 

Glad it's working!  You had mentioned needing a related list in the title of this post so that's why I suggested the custom table.  Honestly, if you just need to know which request (RITM) where the BR was created and not when requests are made for additional updates to it, not sure you really need to the custom table.  Having the RITM reference field on the BR form may be all you need.

That is the first thing I did but that didn't give the related list. There may be multiple RITM and having the related list would give a quick view to who and when the request and change was made.

Interesting perspective, I can't fully visualise your intentions (i'm a visual person ha!) but it's not something I've considered.