Opened by Field on RITM vs. Opened by Variable

Linda_G
Kilo Sage

Good morning, we have a catalog item in which we need to use opened by as a variable due to some approvals needed.  The problem i'm having is that when we switch the opened by variable on the form, the opened by field on the RITM (see attached) stays as the person who actually opened it.  We ran into an issue where I had to cancel and reopen a bunch of tasks, so this caused an issue with notifications and such.

How do i get the opened by on the variable and the opened by on the REQ, RITM, SCTask to match? Any help is appreciated.

find_real_file.png

1 ACCEPTED SOLUTION

Ravindra Lodhi
Kilo Expert

Hello Linda Grant,

You can use Run script activity in the workflow of the item.This code will help you

For Requested Item :

current.opened_by = current.variables.opened_by;

for Request :

var request = new GlideRecord('sc_request');

request.addQuery('sys_id',current.request);

request.query();

if(request.next())

{

request.opened_by = current.variables.opened_by;

request.update();

}

I hope this will help.

 

View solution in original post

3 REPLIES 3

Anil Lande
Kilo Patron

Hi,

If it is for catalog item then you can populate RITM and SC Request field using workflow of Flow running for particular catalog item.

If this is Global change then you can use After insert BR or Flow and copy the variable value into Opened_by field.

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Anil Lande
Kilo Patron

You can put below logic to update opened by on RITM using workflow or BR.

if(current.variables.opened_by !=''){
		current.opened_by = current.variables.opened_by.toString();
	}

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Ravindra Lodhi
Kilo Expert

Hello Linda Grant,

You can use Run script activity in the workflow of the item.This code will help you

For Requested Item :

current.opened_by = current.variables.opened_by;

for Request :

var request = new GlideRecord('sc_request');

request.addQuery('sys_id',current.request);

request.query();

if(request.next())

{

request.opened_by = current.variables.opened_by;

request.update();

}

I hope this will help.